mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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:
parent
e782ba2fee
commit
febc4b6438
1 changed files with 8 additions and 3 deletions
|
@ -35,9 +35,14 @@ metrics.open_sockets.monitor()
|
||||||
|
|
||||||
if (Settings.catchErrors) {
|
if (Settings.catchErrors) {
|
||||||
process.removeAllListeners('uncaughtException')
|
process.removeAllListeners('uncaughtException')
|
||||||
process.on('uncaughtException', error =>
|
process.removeAllListeners('unhandledRejection')
|
||||||
|
process
|
||||||
|
.on('uncaughtException', error =>
|
||||||
logger.error({ err: error }, 'uncaughtException')
|
logger.error({ err: error }, 'uncaughtException')
|
||||||
)
|
)
|
||||||
|
.on('unhandledRejection', (reason, p) => {
|
||||||
|
logger.error({ err: reason }, 'unhandledRejection at Promise', p)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create ./data/dumpFolder if needed
|
// Create ./data/dumpFolder if needed
|
||||||
|
|
Loading…
Reference in a new issue