Skip to content

async parallel error handling #334

@MichaelMcKavanagh

Description

@MichaelMcKavanagh

When processing multiple functions in parallel, using async parallel, if one of those functions throws an error via it's callback, async parallel processes it's callback before some of it's functions have completed. This may be the desired behaviour under some situations, however, I desire different logic. I would like all functions to run regardless of if some of them error or not, and then to be able to process through an error array after they have all completed processing.

My workaround for this situation currently is for my functions running in parallel to always not throw an error via normal way, but instead pretend they succeeded, and pass their error/data through an object in the result. In this way all of the functions will run, and then I have to manually process through the result objects looking for and handling any errors.

However, bypassing normal error handling in order to workaround async parallel isn't ideal in my mind. Perhaps there could be a better solution to provide either option for us, depending on the desired behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions