Skip to content Skip to sidebar Skip to footer

A Promise Was Created In A Handler But Was Not Returned From It

I've just started using bluebird promises and am getting a confusing error Code Abstract var jQueryPostJSON = function jQueryPostJSON(url, data) { return Promise.resolve(

Solution 1:

You're getting the warning because you are - as it says - not returning the promise from the then handler. Where the rejection is coming from would best be tracked by catching it and logging it. That there is no stack trace suggests that you (or one of the libs you use) is throwing a plain object that is not an Error. Try finding and fixing that.

Your call should look like this:

api.getCurrentProcessInstanceTask().then(function(task) {
    return api.completeTask(task);
//  ^^^^^^
}).catch(function(err) {
// ^^^^^console.error(err);
});

Post a Comment for "A Promise Was Created In A Handler But Was Not Returned From It"