Created
February 22, 2019 21:06
-
-
Save forced-request/fc8a0f6796eda21bc72a428d8201263e to your computer and use it in GitHub Desktop.
Handle all uncaught exceptions to prevent node service from crashing. This is useful for preventing denial-of-service attacks in Node.JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tell Node not to crash */ | |
process.on('uncaughtException', function (err) { | |
console.log('Caught exception: ', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment