Skip to main content

Command Palette

Search for a command to run...

Error #Node Quick Notes.

Updated
1 min read
  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.

More from this blog

React with Ajay

17 posts