Created
April 17, 2013 22:44
-
-
Save qharlie/5408391 to your computer and use it in GitHub Desktop.
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
process.on('uncaughtException', function (err) { | |
var stack = err.stack.replace(/^[^\(]+?[\n$]/gm, '') | |
.replace(/^\s+at\s+/gm, '') | |
.replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') | |
.split('\n'); | |
logger.log('Uncaught exception', stack); | |
// Email somebody | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment