hello I would like to create an unhandledRejection if it returns several errors afterwards script exit I will explain why
process.on ('unhandledRejection', (reason, p) => {
console.error ('Unhandled Rejection at: Promise', p, 'reason:', reason);
run();
});
here my script is restarted in case of error but I would like it to stop in case of multiple error afterwards I don't know how to do it if you have an idea
here is an example of in case of error the script stops:
process.on ('unhandledRejection', (reason, p) => {
console.error ('Unhandled Rejection at: Promise', p, 'reason:', reason);
process.exit();
});