Created
January 22, 2015 10:26
-
-
Save yutin1987/74d35bec100c6df82ba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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