Skip to content

Commit

Permalink
Merge pull request #847 from ZYUN-MSFT/user/zyun/loopback
Browse files Browse the repository at this point in the history
[patch] Fix when add loopback exemption failed will break the debug process
  • Loading branch information
millerds committed Apr 4, 2024
2 parents bea5f44 + 05bc65c commit fe70da3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/office-addin-debugging/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,18 @@ export async function startDebugging(manifestPath: string, options: StartDebuggi
// enable loopback for Edge
if (isWindowsPlatform && parseInt(os.release(), 10) === 10) {
const name = isDesktopAppType ? "EdgeWebView" : "EdgeWebBrowser";
await devSettings.ensureLoopbackIsEnabled(name);
try {
await devSettings.ensureLoopbackIsEnabled(name);
} catch (err: any) {
// if add loopback exemption failed, report the error then continue
console.error(err)
console.warn("Failed to add loopback exemption.\nWill try to sideload the Office Add-in without the loopback exemption, but it might not load correctly from localhost.\n")
usageDataObject.reportException("startDebugging()", err, {
app: app,
document: document,
appType: appType,
});
}
}

// enable debugging
Expand Down

0 comments on commit fe70da3

Please sign in to comment.