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 = () => {
8686 } ) ;
8787} ;
8888
89+ function disableEventReporting ( ) {
90+ Sentry . getCurrentHub ( ) . getClient ( ) . getOptions ( ) . enabled = false ;
91+ }
92+
8993const amMainInstance = app . requestSingleInstanceLock ( ) ;
9094if ( ! amMainInstance ) {
9195 console . log ( 'Not the main instance - quitting' ) ;
@@ -120,13 +124,16 @@ if (!amMainInstance) {
120124 reportError ( error ) ;
121125 }
122126
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.
124129 app . quit ( ) ;
130+ process . nextTick ( disableEventReporting ) ;
125131 } ) ;
126132 } else {
127133 // Make sure we clean up the whole group (shell + node).
128134 // https://azimi.me/2014/12/31/kill-child_process-node-js.html
129135 process . kill ( - server . pid ) ;
136+ process . nextTick ( disableEventReporting ) ;
130137 }
131138 } catch ( error ) {
132139 console . log ( 'Failed to kill server' , error ) ;
You can’t perform that action at this time.
0 commit comments