Created
October 9, 2017 02:32
-
-
Save bhrott/2e7f2bec6ac07eabdfbbaa88cd9520e2 to your computer and use it in GitHub Desktop.
NodeJS: handle uncaught errors
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
// add this code before all: | |
process.on('uncaughtException', function(err) { | |
console.error(err.stack); | |
console.log('UNCAUGHT_EXCEPTION: ' + err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment