fix: add global uncaught exception handlers to capture startup crashes
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 31s
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 31s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
79018e8d86
commit
80ac9f9834
17
src/main.ts
17
src/main.ts
@ -97,4 +97,19 @@ async function bootstrap() {
|
|||||||
await app.listen(port);
|
await app.listen(port);
|
||||||
console.log(`[API] Server running on http://localhost:${port}`);
|
console.log(`[API] Server running on http://localhost:${port}`);
|
||||||
}
|
}
|
||||||
bootstrap();
|
// Startup Crash Diagnostics
|
||||||
|
process.on('uncaughtException', (err) => {
|
||||||
|
console.error('[FATAL] Uncaught Exception:', err.message);
|
||||||
|
console.error(err.stack);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
process.on('unhandledRejection', (reason) => {
|
||||||
|
console.error('[FATAL] Unhandled Rejection:', reason);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
bootstrap().catch((err) => {
|
||||||
|
console.error('[FATAL] Bootstrap failed:', err.message);
|
||||||
|
console.error(err.stack);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user