diff --git a/src/app.ts b/src/app.ts index 616f5d58..869146d8 100644 --- a/src/app.ts +++ b/src/app.ts @@ -114,9 +114,13 @@ export class GBServer { }); process.on('uncaughtException', (err, p) => { - GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`); + if (err !== null) { + GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`); + } else { + GBLog.error('UNCAUGHT_EXCEPTION: Unknown error (err is null)'); + } }); - + process.on('SIGTERM', () => { GBLog.info('SIGTERM signal received.'); });