fix: process not quitting on errors

This commit is contained in:
Yanlong Wang 2024-04-21 10:17:05 +08:00
parent 17415ed1f1
commit 4b208f44b5
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -23,5 +23,17 @@ process.on('unhandledRejection', (err) => {
return;
}
// Looks like Firebase runtime does not handle error properly.
// Make sure to quit the process.
process.nextTick(() => process.exit(1));
throw err;
});
process.on('uncaughtException', (err) => {
// Looks like Firebase runtime does not handle error properly.
// Make sure to quit the process.
process.nextTick(() => process.exit(1));
throw err;
});