Closed jeroen closed 11 months ago
This works on the node level.
process.on('uncaughtException', (err) => {
console.log(err);
});
Some of the async IO uncaught exceptions are fixed in express 5, but that seems forever in beta. But you can test it:
npm install "express@>=5.0.0-beta.1" --save
Maybe a restart is actually the safest option in case of OOM errors.
Decided to not change behavior for now, because restarting on fatal errors may just seem like the safest approach, in case the server is in a bad state.
See if there is a way to make express not exit node for uncaught errors.