to avoid node.js callback hell, i am using async.js to organize my code. its using one callback function at the end to catch all the error. is it possible to find out where it throws the exception.
in following example, there are 3 functions in the array, i want to know where it fails, so I can create a customized error message.
async.waterfall([
function(callback){
callback(null, 'one', 'two');
},
function(arg1, arg2, callback){
callback(null, 'three');
},
function(arg1, callback){
// arg1 now equals 'three'
callback(null, 'done');
}
], function (err, result) {
// result now equals 'done'
console.log("error:" + err);
});