Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created January 30, 2013 07:53
Show Gist options
  • Save garaemon/4671508 to your computer and use it in GitHub Desktop.
Save garaemon/4671508 to your computer and use it in GitHub Desktop.
function hoge(next) {
fuga(function(err, piyo) {
if (err != null) {
next(err);
}
else {
...
}
});
}
function hoge(next){
try {
fuga(function(err, piyo) {
if (err != null) {
throw err;
}
else {
...
}
})
}
catch(e) {
next(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment