Skip to content

Commit

Permalink
feat(defaultErrorHandler): Do not invoke default error handler for AB…
Browse files Browse the repository at this point in the history
…ORTED transitions

BREAKING CHANGE: ABORTED transitions do not invoke the `defaultErrorHandler`

Returning `false` from a transition hook will abort the transition.

- #### Old behavior

Previously, this case was considered an error and was logged by
`defaultErrorHandler`.
After your feedback, we agree that this is not typically an error.

- #### New behavior

Now, aborted transitions do not trigger the `defaultErrorHandler`

- #### Motivation:

> Why introduce a BC?

Most users do not consider ABORT to be an error.  The default error
handler should match this assumption.

- #### BC liklihood

> How likely am I to be affected?

Low: Most users do not consider ABORT to be an error. For most users
this will not be a BC.

- #### BC severity

> How severe is this BC?

Low: Users who want to handle all transition rejections can
register a `.onError` handler and filter/process accordingly.
  • Loading branch information
christopherthielen committed Feb 23, 2017
1 parent bfa7520 commit b07a24b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state/stateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class StateService {

if (error.type === RejectType.ABORTED) {
router.urlRouter.update();
// Fall through to default error handler
return services.$q.reject(error);
}
}

Expand Down

0 comments on commit b07a24b

Please sign in to comment.