mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 00:19:42 +02:00
chore: bump version to 0.1488
This commit is contained in:
+15
-2
@@ -10,15 +10,28 @@
|
||||
|
||||
import { program } from './cli.js';
|
||||
|
||||
// Detect if we're running the web server (long-lived process)
|
||||
// In web mode, we should NOT exit on transient errors — log and continue
|
||||
const isWebMode = process.argv.includes('web');
|
||||
|
||||
// Handle uncaught errors
|
||||
process.on('uncaughtException', (err) => {
|
||||
console.error('Uncaught exception:', err.message);
|
||||
process.exit(1);
|
||||
if (isWebMode) {
|
||||
// Log full stack trace for debugging but keep the server running
|
||||
console.error('[RECOVERED] Server continuing after uncaught exception:', err.stack);
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason) => {
|
||||
console.error('Unhandled rejection:', reason);
|
||||
process.exit(1);
|
||||
if (isWebMode) {
|
||||
console.error('[RECOVERED] Server continuing after unhandled rejection');
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Run CLI
|
||||
|
||||
Reference in New Issue
Block a user