Skip to content

Instantly share code, notes, and snippets.

@yutin1987
Created January 22, 2015 10:26
Show Gist options
  • Save yutin1987/74d35bec100c6df82ba6 to your computer and use it in GitHub Desktop.
Save yutin1987/74d35bec100c6df82ba6 to your computer and use it in GitHub Desktop.
var async = require('async');
var trycatch = require('trycatch');
function doSomething(cb) {
setTimeout(function(){
throw 999;
});
}
trycatch(function(){
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', err);
}
);
}, function(err){
console.log('catch', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment