Created
December 17, 2014 05:40
-
-
Save ryanwilliamquinn/434d6d5d0f921618af08 to your computer and use it in GitHub Desktop.
error catching machine
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
var BPromise = require('bluebird'); | |
BPromise.try(function () { | |
console.log(1); | |
console.log(x.y); | |
console.log(2); | |
}).catch(function (err) { | |
console.log('caught an error with try', err); | |
}); | |
new BPromise(function (resolve) { | |
console.log(1); | |
console.log(x.y); | |
console.log(2); | |
resolve('wtf'); | |
}).catch(function (err) { | |
console.log('caught an error without try', err); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment