Answer the question
In order to leave comments, you need to log in
Catching node.js errors?
For some reason, the program falls off without any errors in the logs. I catch fatal errors and exit events like this:
[
'exit',
'SIGINT',
'SIGTERM',
'SIGBREAK'
].forEach(event =>
{
process.on(event, () =>
{
Cleanup(event)
})
})
process.on('uncaughtException\n', err =>
{
console.error('Неотловленная ошибка', err.message, err.stack)
})
process.on('unhandledRejection\n', (reason, promise) =>
{
console.error('Ошибка unhandledRejection', reason)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question