It would be nave to have Error objects instead of just plan objects...IE:
function callRpc(cmd, args, rpc) {
var fn = args[args.length-1];
// If the last function is a callback, pop it from the args list
if(_.isFunction(fn)) {
args.pop();
} else {
fn = function () {};
}
rpc.call(cmd, args, function(){
var args = [].slice.call(arguments);
args.unshift(null);
fn.apply(this, args);
}, function(err){
fn(_.extend(new Error(), err));
});
}
It would be nave to have Error objects instead of just plan objects...IE: