Skip to content

(legacy) errors thrown from onEnter callbacks are swallowed #2772

Closed
@metamatt

Description

@metamatt

I noticed on a project using the 0.2.15 codebase that if my onEnter (or similar) callback throws an error, the error is never reported.

I suspected this was because it's getting converted to a promise rejection and nothing was looking at the promise, and traced that to the code in $state.transitionTo: it essentially does return promise.then(success, fail), and returns it back to a call site in registerState which does not look at the return value.

AFAICT from glancing at the code, this bug remains in 0.3.0 but not in the 1.0.0-alpha releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions