mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Unhandled promise rejections no longer kill the whole server if not in development
This commit is contained in:
parent
76023af9d6
commit
d2030e826b
@ -50,8 +50,8 @@ export function ensurePolyfilled() {
|
||||
captureError("unhandled-promise-rejection", reason);
|
||||
if (getNodeEnvironment() === "development") {
|
||||
console.error("\x1b[41mUnhandled promise rejection. Some production environments (particularly Vercel) will kill the server in this case, so the server will now exit. Please use the `ignoreUnhandledRejection` function to signal that you've handled the error.\x1b[0m", reason);
|
||||
(globalThis as any).process.exit(1);
|
||||
}
|
||||
(globalThis as any).process.exit(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,9 +44,9 @@ export function ensurePolyfilled() {
|
||||
captureError("unhandled-promise-rejection", reason);
|
||||
if (getNodeEnvironment() === "development") {
|
||||
console.error("Unhandled promise rejection. Some production environments (particularly Vercel) will kill the server in this case, so the server will now exit. Please use the `ignoreUnhandledRejection` function to signal that you've handled the error.", reason);
|
||||
}
|
||||
if ((globalThis.process as any).exit) {
|
||||
globalThis.process.exit(1);
|
||||
if ((globalThis.process as any).exit) {
|
||||
globalThis.process.exit(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user