Skip to content

when.reduce UnhandledPromiseRejectionWarning #492

@dkebler

Description

@dkebler

This is my when.reduce code

            return reduce(cmds, function(responses, cmd) {
                return processor(cmd).then(function(response) {
                    responses.push(response);
                    return responses;
                })
            }, [])

any rejection in processoror lower gets hung (unhandled) at when.reduce

(node:7520) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): manual rejection in processor**Command Processing Errors** manual rejection in processor

 (node:7520) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)

on the other hand...resolutions bubble up fine
FINAL response back [ 'manual resolution in processor' ]

to make sure it is when reduce I substituted this

return processor(cmds[0]);
and yes both resolutions and rejections bubble on through.

Is there an error in my construction of the reducer function or is this a bug?

Note I am using the latest version of nodejs 6.9.1 which since 6.0 now throws these warnings for any unhandled rejections

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions