Skip to content

Commit 018d4b7

Browse files
committed
Show a clear error if we fail to open external URLs
1 parent 9f5dfb5 commit 018d4b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,14 @@ if (!amMainInstance) {
230230
}
231231

232232
function handleExternalNavigation(url: URL) {
233-
shell.openExternal(url.toString());
233+
shell.openExternal(url.toString())
234+
.catch((error) => {
235+
showErrorAlert(
236+
"Failed to open URL",
237+
`HTTP Toolkit could not open ${url.toString()} in your browser, because: ${error?.message ?? error ?? 'unknown error'}`
238+
);
239+
throw error;
240+
});
234241
}
235242

236243
function showErrorAlert(title: string, body: string) {

0 commit comments

Comments
 (0)