UBERF-4824 Handle unhandled rejections in collaborator (#4302)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-01-04 15:36:40 +07:00 committed by GitHub
parent b685aae286
commit b43231b78e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,14 @@ export async function startCollaborator (): Promise<void> {
void shutdown()
}
process.on('uncaughtException', (e) => {
console.error(e)
})
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason)
})
process.on('SIGINT', close)
process.on('SIGTERM', close)
process.on('exit', close)