Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3515903
D6684.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6684.diff
View Options
diff --git a/desktop/flow-typed/npm/electron_v22.0.0.js b/desktop/flow-typed/npm/electron_v22.0.0.js
--- a/desktop/flow-typed/npm/electron_v22.0.0.js
+++ b/desktop/flow-typed/npm/electron_v22.0.0.js
@@ -391,6 +391,11 @@
senderId: number,
ports: $ReadOnlyArray<MessagePort>,
};
+
+ declare export var dialog: Dialog;
+ declare class Dialog {
+ showErrorBox(title: string, content: string): void;
+ }
}
declare module 'electron/main' {
@@ -402,6 +407,7 @@
ipcMain,
systemPreferences,
autoUpdater,
+ dialog,
} from 'electron';
}
diff --git a/desktop/src/main.js b/desktop/src/main.js
--- a/desktop/src/main.js
+++ b/desktop/src/main.js
@@ -8,6 +8,7 @@
ipcMain,
systemPreferences,
autoUpdater,
+ dialog,
// eslint-disable-next-line import/extensions
} from 'electron/main';
import fs from 'fs';
@@ -286,3 +287,13 @@
} else {
run();
}
+
+process.on('uncaughtException', (error: Error) => {
+ if (error.message === 'The internet connection appears to be offline.') {
+ return;
+ }
+ dialog.showErrorBox(
+ 'A JavaScript error occurred in the main process',
+ `Uncaught Exception: ${error.name}: ${error.message}`,
+ );
+});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 10:57 AM (19 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694516
Default Alt Text
D6684.diff (1 KB)
Attached To
Mode
D6684: [desktop] Ignore exceptions about being offline
Attached
Detach File
Event Timeline
Log In to Comment