Created
January 26, 2011 20:16
-
-
Save pguillory/797354 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
f1(function(err) { | |
console.log(err); | |
}); | |
function f1(callback) { | |
// throw new Error("You can catch me."); | |
f2(function(err) { | |
if (err) return callback(err); | |
f3(function(err) { | |
if (err) return callback(err); | |
return callback(null); | |
}) | |
}) | |
} | |
function f2(callback) { | |
// return callback(new Error("I'll propagate through the callback.")) | |
return callback(null); | |
} | |
function f3(callback) { | |
throw new Error("I'm the gingerbread man and I'll crash your program."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment