Last active
July 22, 2016 15:34
-
-
Save EugeneKostrikov/175d150b9e997c901270b8c605ac358f to your computer and use it in GitHub Desktop.
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 when = require('when'); //It is a regular A+ Promises library | |
function somethingThatThrows(){ | |
throw new Error('Boom'); | |
} | |
when.resolve('Hello') | |
.then(function(result){ | |
somethingThatThrows(); | |
return result; | |
}, function(err){ | |
console.log('gotcha ', err); | |
return 'Ciao'; | |
}) | |
.then(function(result){ | |
console.log('result ', result); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment