Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
metamatt opened this issue May 27, 2016 · 1 comment
Closed

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

metamatt opened this issue May 27, 2016 · 1 comment
Labels
Milestone

Comments

@metamatt
Copy link

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.

@metamatt
Copy link
Author

If we use promise.then(success).catch(fail), the fail handler gets invoked for failures in the success handler as well as rejections already captured by promise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants