DEV Community

Ajay Baraiya
Ajay Baraiya

Posted on

Error #Node Quick Notes.

  1. Errors are handled with exceptions.
  2. throw keyword to break normal exectuion of javascript.
  3. Node.js has Error class from Error core module.
  4. Do, throw Error("My new error message."); or extend class and throw like Class MyCustomError extends Error(){}; throw new MyCustomError();
  5. uncaughtException there is predefined code block on https://nodejs.dev/en/learn/error-handling-in-nodejs/, implement it to avoid this error.
  6. Error handling with Promises.
  7. Error handling with Async/Wait.

Top comments (0)