@@ -19,6 +19,30 @@ import * as Sentry from '@sentry/electron/main'
1919import path from 'node:path'
2020import { stopIdleMonitoring } from './idleMonitor'
2121
22+ // Global error handlers to capture full error details
23+ process . on ( 'uncaughtException' , ( error ) => {
24+ console . error ( '=== UNCAUGHT EXCEPTION ===' )
25+ console . error ( 'Error name:' , error . name )
26+ console . error ( 'Error message:' , error . message )
27+ console . error ( 'Error stack:' , error . stack )
28+ console . error ( 'Full error object:' , JSON . stringify ( error , Object . getOwnPropertyNames ( error ) , 2 ) )
29+
30+ // Show error dialog
31+ dialog . showErrorBox (
32+ 'A JavaScript error occurred in the main process' ,
33+ `${ error . name } : ${ error . message } \n\nStack:\n${ error . stack } `
34+ )
35+ } )
36+
37+ process . on ( 'unhandledRejection' , ( reason , promise ) => {
38+ console . error ( '=== UNHANDLED REJECTION ===' )
39+ console . error ( 'Promise:' , promise )
40+ console . error ( 'Reason:' , reason )
41+ if ( reason instanceof Error ) {
42+ console . error ( 'Error stack:' , reason . stack )
43+ }
44+ } )
45+
2246const gotTheLock = app . requestSingleInstanceLock ( )
2347if ( ! gotTheLock ) {
2448 app . quit ( )
0 commit comments