From 2c77247a86672686277112dd7b49dc653d8f4744 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 27 May 2020 18:16:56 +0200 Subject: [PATCH] fix(errors): avoid unnecessary log of errors --- src/history/base.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/history/base.js b/src/history/base.js index 3a96bb3ba..ce98f18e9 100644 --- a/src/history/base.js +++ b/src/history/base.js @@ -15,8 +15,7 @@ import { createNavigationDuplicatedError, createNavigationCancelledError, createNavigationRedirectedError, - createNavigationAbortedError, - NavigationFailureType + createNavigationAbortedError } from './errors' export class History { @@ -114,11 +113,10 @@ export class History { confirmTransition (route: Route, onComplete: Function, onAbort?: Function) { const current = this.current const abort = err => { - // after merging https://github.com/vuejs/vue-router/pull/2771 we - // When the user navigates through history through back/forward buttons - // we do not want to throw the error. We only throw it if directly calling - // push/replace. That's why it's not included in isError - if (!isRouterError(err, NavigationFailureType.duplicated) && isError(err)) { + // changed after adding errors with + // https://github.com/vuejs/vue-router/pull/3047 before that change, + // redirect and aborted navigation would produce an err == null + if (!isRouterError(err) && isError(err)) { if (this.errorCbs.length) { this.errorCbs.forEach(cb => { cb(err)