fix: don't exit the script when exceptions occur
This commit is contained in:
parent
7a00d24ab9
commit
13be78dee8
@ -39,6 +39,18 @@ import {
|
||||
saveFileRL,
|
||||
} from "./ratelimit";
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.error('Uncaught Exception:', error);
|
||||
// Do not exit the process
|
||||
// You can add additional logging or recovery logic here
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
||||
// Do not exit the process
|
||||
// You can also handle the rejected promise here if needed
|
||||
});
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const app: Express = express();
|
||||
|
Loading…
x
Reference in New Issue
Block a user