File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ const createWindow = () => {
86
86
} ) ;
87
87
} ;
88
88
89
+ function disableEventReporting ( ) {
90
+ Sentry . getCurrentHub ( ) . getClient ( ) . getOptions ( ) . enabled = false ;
91
+ }
92
+
89
93
const amMainInstance = app . requestSingleInstanceLock ( ) ;
90
94
if ( ! amMainInstance ) {
91
95
console . log ( 'Not the main instance - quitting' ) ;
@@ -120,13 +124,16 @@ if (!amMainInstance) {
120
124
reportError ( error ) ;
121
125
}
122
126
123
- // We've done our best - now shut down for real
127
+ // We've done our best - now shut down for real. Disable errors, otherwise
128
+ // we can receive reports for invisible errors during/just after exit.
124
129
app . quit ( ) ;
130
+ process . nextTick ( disableEventReporting ) ;
125
131
} ) ;
126
132
} else {
127
133
// Make sure we clean up the whole group (shell + node).
128
134
// https://azimi.me/2014/12/31/kill-child_process-node-js.html
129
135
process . kill ( - server . pid ) ;
136
+ process . nextTick ( disableEventReporting ) ;
130
137
}
131
138
} catch ( error ) {
132
139
console . log ( 'Failed to kill server' , error ) ;
You can’t perform that action at this time.
0 commit comments