Skip to content

Instantly share code, notes, and snippets.

@adamzr
Created February 24, 2016 21:48
The best NodeJS Exception Handler
try {
// Something
}
catch (ex) {
response.writeHead(302, {
'Location': 'https://stackoverflow.com/search?q=[javascript] ' + ex.message
});
response.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment