Created
March 3, 2014 01:07
-
-
Save pyrho/9316787 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
var Promise = require('bluebird'); | |
function testFailReject(){ | |
return Promise.reject(new Error('An error happened')); | |
} | |
testFailReject() | |
.error(function(error){ | |
console.log("Got Error:" + error); | |
}) | |
.then(function(res){ | |
console.log("Got then: " + res); | |
}) | |
.catch(function(exc){ | |
console.log("Got Exc: " + exc); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment