From 871d79e2a2bf235796e2f3c78923400bf25faaab Mon Sep 17 00:00:00 2001 From: Warren Seymour Date: Tue, 23 Jan 2018 12:57:44 +0000 Subject: [PATCH] feat(ui-router): Don't display default error handler when a transition is superceded A transition being superseded does not necessarily denote an error, so the default error handler should not be used in this case. --- src/ui-router.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui-router.tsx b/src/ui-router.tsx index 307bae8..7a15754 100644 --- a/src/ui-router.tsx +++ b/src/ui-router.tsx @@ -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',