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 Promise = require('promise'); | |
// Step 1 fails and rejects it's promise | |
function step1() { | |
return new Promise(function(resolve, reject) { | |
reject('Something went wrong'); | |
}); | |
} | |
// Step 2 doesn't do anything to handle error |
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 handlers = []; | |
handlers.push(function(next) { | |
console.log ('first handler'); | |
next(); | |
}); | |
handlers.push(function(next) { | |
console.log ('second handler'); | |
next(); |
NewerOlder