Skip to content

Instantly share code, notes, and snippets.

@pyrho
Created March 3, 2014 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyrho/9316787 to your computer and use it in GitHub Desktop.
Save pyrho/9316787 to your computer and use it in GitHub Desktop.
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