mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #21049 from overleaf/tm-web-unhandledrejection
Add unhandledRejection handler when catchErrors is true GitOrigin-RevId: 7ec1512a8705e6f7cf6480b70427f5bf5d1438b4
This commit is contained in:
@@ -35,9 +35,14 @@ metrics.open_sockets.monitor()
|
||||
|
||||
if (Settings.catchErrors) {
|
||||
process.removeAllListeners('uncaughtException')
|
||||
process.on('uncaughtException', error =>
|
||||
logger.error({ err: error }, 'uncaughtException')
|
||||
)
|
||||
process.removeAllListeners('unhandledRejection')
|
||||
process
|
||||
.on('uncaughtException', error =>
|
||||
logger.error({ err: error }, 'uncaughtException')
|
||||
)
|
||||
.on('unhandledRejection', (reason, p) => {
|
||||
logger.error({ err: reason }, 'unhandledRejection at Promise', p)
|
||||
})
|
||||
}
|
||||
|
||||
// Create ./data/dumpFolder if needed
|
||||
|
||||
Reference in New Issue
Block a user