Skip to content

Commit 2c77247

Browse files
committed
fix(errors): avoid unnecessary log of errors
1 parent 0b93901 commit 2c77247

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/history/base.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import {
1515
createNavigationDuplicatedError,
1616
createNavigationCancelledError,
1717
createNavigationRedirectedError,
18-
createNavigationAbortedError,
19-
NavigationFailureType
18+
createNavigationAbortedError
2019
} from './errors'
2120

2221
export class History {
@@ -114,11 +113,10 @@ export class History {
114113
confirmTransition (route: Route, onComplete: Function, onAbort?: Function) {
115114
const current = this.current
116115
const abort = err => {
117-
// after merging https://github.com/vuejs/vue-router/pull/2771 we
118-
// When the user navigates through history through back/forward buttons
119-
// we do not want to throw the error. We only throw it if directly calling
120-
// push/replace. That's why it's not included in isError
121-
if (!isRouterError(err, NavigationFailureType.duplicated) && isError(err)) {
116+
// changed after adding errors with
117+
// https://github.com/vuejs/vue-router/pull/3047 before that change,
118+
// redirect and aborted navigation would produce an err == null
119+
if (!isRouterError(err) && isError(err)) {
122120
if (this.errorCbs.length) {
123121
this.errorCbs.forEach(cb => {
124122
cb(err)

0 commit comments

Comments
 (0)