Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Promise = require('bluebird');
- function doSomething() {
- // return Promise.resolve();
- // return Promise.reject(new Error("Error doSomething"));
- return new Promise(function (f, r) {
- f();
- });
- }
- function doAnother() {
- // return Promise.reject(new Error("Error doAnother"));
- return new Promise(function (f, r) {
- r(new Error("Error doAnother"));
- });
- }
- doSomething().then(doAnother).then(function() {
- console.log("fullifillidHandler");
- }, function(err) {
- console.log("rejectHandler", err.message);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement