Skip to content

Commit

Permalink
feat(ui-router): Don't display default error handler when a transitio…
Browse files Browse the repository at this point in the history
…n is superceded

A transition being superseded does not necessarily denote an error, so the default error handler
should not be used in this case.
  • Loading branch information
wms committed Jan 23, 2018
1 parent 6d7600c commit 871d79e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ui-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export const buildRouter = (): UIRouterReact => {
router.plugin(UIRouterRx);

router.stateService.defaultErrorHandler(err => {
// 'Transition Superseded' errors should not be handled
if (err.type && err.type === 2) {
return;
}

notification.error({
message: 'State Transition Error',

Expand Down

0 comments on commit 871d79e

Please sign in to comment.