angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

$state.go invalid Transition not triggering global error handlers Transition.onError and StateService.defaultErrorHandler #3610

Closed Noah-Silvera closed 4 years ago

Noah-Silvera commented 6 years ago

This is a (check one box):

My version of UI-Router is: (1.0.13)

Bug Report

Current Behavior:

When $state.go is passed an invalid state name with invalid state parameters, the rejection does not call the defaultErrorHandler or the Transition.onErrorHandler

Example - I call $state.go('invalidStateNameItDoesntExist'). If i add a .then((err)=>{}) handler, this is called, but the global error handlers are NOT called.

Expected Behavior:

Since this is a transition error, I expect the global error handlers to be called so I can handle this failed transition globally with a redirect

error message captured from the promise error handler

Transition Rejection($id: 0 type: 4, message: This transition is invalid, detail: Could not resolve 'invalidState' from state 'home')

Link to Plunker or stackblitz that reproduces the issue:

http://plnkr.co/edit/282gLW90RoRuqUUQGmGH?p=preview

adamreisnz commented 6 years ago

May be a duplicate of https://github.com/angular-ui/ui-router/issues/3212

silentFred commented 5 years ago

Any movement on this? Also experiencing the same issue

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.