An Interest In:
Web News this Week
- March 5, 2024
- March 4, 2024
- March 3, 2024
- March 2, 2024
- March 1, 2024
- February 29, 2024
- February 28, 2024
September 11, 2022 05:59 am GMT
Original Link: https://dev.to/ajaybaraiya6/error-node-quick-notes-4kk1
Error Node Quick Notes.
- Errors are handled with exceptions.
- throw keyword to break normal exectuion of javascript.
- Node.js has Error class from Error core module.
- Do,
throw Error("My new error message.");
or extend class and throw likeClass MyCustomError extends Error(){}; throw new MyCustomError();
- uncaughtException there is predefined code block on https://nodejs.dev/en/learn/error-handling-in-nodejs/, implement it to avoid this error.
- Error handling with Promises.
- Error handling with Async/Wait.
Original Link: https://dev.to/ajaybaraiya6/error-node-quick-notes-4kk1
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To