Created
March 18, 2012 18:49
-
-
Save jakobmattsson/2079663 to your computer and use it in GitHub Desktop.
Propagating async javascript errors
This file contains hidden or 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 propagate = function(callback, f) { | |
return function(err) { | |
if (err) { | |
callback(err); | |
return; | |
} | |
return f.apply(this, Array.prototype.slice.call(arguments, 1)); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment