fix: Uncaught error in JSZip file reading crashes worker process. closes #6109

This commit is contained in:
Tom Moor
2023-11-04 21:50:45 -04:00
parent c769a95f65
commit ec79cab8b8
2 changed files with 7 additions and 1 deletions

View File

@@ -164,6 +164,13 @@ async function start(id: number, disconnect: () => void) {
ShutdownHelper.add("metrics", ShutdownOrder.last, () => Metrics.flush());
// Handle uncaught promise rejections
process.on("unhandledRejection", (error: Error) => {
Logger.error("Unhandled promise rejection", error, {
stack: error.stack,
});
});
// Handle shutdown signals
process.once("SIGTERM", () => ShutdownHelper.execute());
process.once("SIGINT", () => ShutdownHelper.execute());