Skip to content

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

@Noah-Silvera

Description

@Noah-Silvera

This is a (check one box):

  • Bug Report
  • Feature Request
  • General Query

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions