Skip to content

2 problems with Reject throwing errors #39

Description

@cscalfani
  1. Unhandled errors in reject throw errors in a setTimeout making catching them impossible. It would be nice to NOT use setTimeout if exports.errorTimeout == 0.
  2. When the error is thrown, it should be wrapped in an Error() if not already instanceof Error so a stack trace can be had.

Currently, there is no way to catch a forgotten call to reject with a dontThrow parameter. The exception is caught in an unhandled exception handler but that kills my app (as it should).

Also, it would be nice if this behavior was documented.

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