Skip to content

Can't throw an exception with a given stack trace #35494

@Hixie

Description

@Hixie

I have a class similar to Completer. It has a method similar to completeError which takes an exception and stack trace (typically one caught in a try/catch block in user code). There is a situation in which I want to be able to cause this exception to be rethrown at a later point synchronously (similar to how a Future that doesn't have an error handler passes the error to the zone's uncaught error handler).

However, there's no current way to rethrow the exception with a given StackTrace object.

Ideally you'd be able to do something like:

  throw error at stack;

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