Skip to content

Instantly share code, notes, and snippets.

@yutin1987
Created January 22, 2015 10:59
Show Gist options
  • Save yutin1987/cb386f7400ebb4b7d384 to your computer and use it in GitHub Desktop.
Save yutin1987/cb386f7400ebb4b7d384 to your computer and use it in GitHub Desktop.
var async = require('async');
function doSomething(cb) {
setTimeout(function(){
throw 999;
});
}
try {
async.series(
[
function(cb) {
console.log(123);
cb();
},
function(cb) {
console.log(456);
cb();
},
function(cb) {
doSomething(cb);
},
function(cb) {
console.log(111);
cb();
}
],
function(err, data){
console.log(err);
}
);
}
catch(err) {
console.log(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment