From 1f3b2a280dd56b4fa1633ce58e8a392683e034c9 Mon Sep 17 00:00:00 2001
From: Arya Singh <72375247+ARYASINGHBJC@users.noreply.github.com>
Date: Fri, 21 Oct 2022 23:07:06 +0530
Subject: [PATCH] Add content for error handling in node.js (#2492)
---
.../103-nodejs-error-handling/102-uncaught-exceptions.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/102-uncaught-exceptions.md b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/102-uncaught-exceptions.md
index 6fe184a02..b72b3ed2c 100644
--- a/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/102-uncaught-exceptions.md
+++ b/content/roadmaps/107-nodejs/content/103-nodejs-error-handling/102-uncaught-exceptions.md
@@ -2,7 +2,7 @@
When a JavaScript error is not properly handled, an uncaughtException is emitted. These suggest the programmer has made an error, and they should be treated with the utmost priority.
-The correct use of 'uncaughtException' is to perform synchronous cleanup of allocated resources (e.g. file descriptors, handles, etc) before shutting down the process. It is not safe to resume normal operation after 'uncaughtException'.
+The correct use of `uncaughtException` is to perform synchronous cleanup of allocated resources (e.g. file descriptors, handles, etc) before shutting down the process. It is not safe to resume normal operation after `uncaughtException` because system becomes corrupted. The best way is to let the application crash, log the error and then restart the process automatically using nodemon or pm2.
Free Content
Official Website