File tree 1 file changed +3
-12
lines changed
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -97,18 +97,9 @@ class Graceful {
97
97
} ) ;
98
98
99
99
// handle uncaught exceptions
100
- process . once ( 'uncaughtException' , ( err ) => {
101
- // always log to console the error (e.g. so we can see it on pm2 logs)
102
- console . error ( err ) ;
103
- if ( this . config . hideMeta )
104
- this . config . logger . error ( err , { [ this . config . hideMeta ] : true } ) ;
105
- else this . config . logger . error ( err ) ;
106
- // artificial timeout to allow logger to store uncaught exception to db
107
- if ( this . config . uncaughtExceptionTimeoutMs )
108
- setTimeout ( ( ) => {
109
- process . exit ( 1 ) ;
110
- } , this . config . uncaughtExceptionTimeoutMs ) ;
111
- else process . exit ( 1 ) ;
100
+ process . on ( 'uncaughtExceptionMonitor' , ( err , origin ) => {
101
+ console . error ( err , { origin } ) ;
102
+ this . config . logger . fatal ( err , { origin } ) ;
112
103
} ) ;
113
104
114
105
// handle windows support (signals not available)
You can’t perform that action at this time.
0 commit comments