You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
metamatt
added a commit
to metamatt/ui-router
that referenced
this issue
May 27, 2016
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 inregisterState
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.
The text was updated successfully, but these errors were encountered: