Node.js Error Handling
JS
S
JavaScriptError handling standards on Node.js
1process.on("unhandledRejection", (reason) => {
2 throw reason;
3});
4
5process.on("uncaughtException", (err) => {
6 console.error("There was an uncaught error", err);
7 process.exit(1);
8});Created on 2/21/2022