|
|
|
|
|
by MatthewPhillips
4884 days ago
|
|
You can wrap your callback functions and handle errors all in one spot. Example: var slice = Array.prototype.slice;
function errHandler(callback) {
return function(err) {
if(err) {
// Error handling code here.
} else {
callback(slice.call(arguments, 1));
}
};
}
|
|