From 460da72850f6d2e15b952a060fcba945bf832217 Mon Sep 17 00:00:00 2001 From: Kalpit Shah Date: Sat, 22 Oct 2022 22:15:26 +0530 Subject: [PATCH] Add content for errors in Node.js roadmap (#2695) * Update 101-system-errors.md * Update 102-user-specified-errors.md * Update content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/101-system-errors.md * Update content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/102-user-specified-errors.md Co-authored-by: Kamran Ahmed --- .../103-error-types/101-system-errors.md | 25 ++++++++++++++++++- .../102-user-specified-errors.md | 7 +++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/101-system-errors.md b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/101-system-errors.md index cb61c63d5..2a34e29bb 100644 --- a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/101-system-errors.md +++ b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/101-system-errors.md @@ -1 +1,24 @@ -# System errors \ No newline at end of file +# System Errors + +Node.js generates system errors when exceptions occur within its runtime environment. These usually occur when an application violates an operating system constraint. +For example, a system error will occur if an application attempts to read a file that does not exist. + +Below are the system errors commonly encountered when writing a Node.js program + +1. EACCES - Permission denied +2. EADDRINUSE - Address already in use +3. ECONNRESET - Connection reset by peer +4. EEXIST - File exists +5. EISDIR - Is a directory +6. EMFILE - Too many open files in system +7. ENOENT - No such file or directory +8. ENOTDIR - Not a directory +9. ENOTEMPTY - Directory not empty +10. ENOTFOUND - DNS lookup failed +11. EPERM - Operation not permitted +12. EPIPE - Broken Pipe +13. ETIMEDOUT - Operation timed out + + +Free Content +Node.js Errors - Official Docs diff --git a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/102-user-specified-errors.md b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/102-user-specified-errors.md index e4572db98..88c1e3787 100644 --- a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/102-user-specified-errors.md +++ b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/103-error-types/102-user-specified-errors.md @@ -1 +1,6 @@ -# User specified errors \ No newline at end of file +# User Specified Errors + +User specified errors can be created by extending the base Error object, a built-in error class. When creating errors in this manner, you should pass a message string that describes the error. This message can be accessed through the message property on the object. The Error object also contains a name and a stack property that indicate the name of the error and the point in the code at which it is created. + +Free Content +A Comprehensive Guide To Error Handling In Node.js