Skip to content

What happens when the factory throws an error? #21

Open
@domenic

Description

In #18, I propose letting the factory run in a new turn per #20, and not catching any thrown errors (i.e. they should just crash the program).

The alternative is to catch any errors and transform them into rejections. This gets a bit complicated, though:

  1. How should resolve(x); throw y; behave?
  2. How should reject(x); throw y; behave?

Plus, it creates a somewhat false parallel between factory and the callbacks to then. The callbacks to then check both return values and thrown errors, while checking return values is not possible for factory.

This is related to what is decided in #20, but in theory any combination could be decided on (same-turn, capture; same-turn, crash; next-turn, capture; next-turn, crash).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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