Skip to content

Instantly share code, notes, and snippets.

@wookimiii
Created February 22, 2014 00:10
Show Gist options
  • Save wookimiii/9146382 to your computer and use it in GitHub Desktop.
Save wookimiii/9146382 to your computer and use it in GitHub Desktop.
A wrapper function to handle errors
function handleError(callback) {
return function(err, data) {
if (err) {
console.trace(err);
res.send(500);
} else {
callback(null, data);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment