Skip to content

Unexpected "Unhandled rejection" with "return" method #721

Description

@tjconcept
var rj = Promise.reject(new Error());

rj
    .return(Promise.join(rj))
    .spread(console.log)
    .catch(console.error);

Gives an "Unhandled rejection Error" with Bluebird 2.9.34.

The example seems freakish, but it is a distilled version of a more complex scenario where the join has more arguments.

My first thought was to swap a simple array for the join, but add another thing to the array, and you're back to square one:

var rja = Promise.reject(new Error());
var rjb = Promise.reject(new Error());

rja
    .return([ rja, rjb ])
    .spread(console.log)
    .catch(console.error);

Gives an "Unhandled rejection Error" as well.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions