Skip to content

Commit

Permalink
fix(errors): avoid unnecessary log of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 27, 2020
1 parent 0b93901 commit 2c77247
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/history/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {
createNavigationDuplicatedError,
createNavigationCancelledError,
createNavigationRedirectedError,
createNavigationAbortedError,
NavigationFailureType
createNavigationAbortedError
} from './errors'

export class History {
Expand Down Expand Up @@ -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)
Expand Down

5 comments on commit 2c77247

@pi0
Copy link

@pi0 pi0 commented on 2c77247 May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks bro :D

@posva
Copy link
Member Author

@posva posva commented on 2c77247 May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 I hope you didn't update to 3.3.0 in its 7h of existence

@pi0
Copy link

@pi0 pi0 commented on 2c77247 May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RenovateBot is our popeye guy discovered it earlier today :D

@lix0x7
Copy link

@lix0x7 lix0x7 commented on 2c77247 May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last night, we tried to deploy our application with "vue-router": "^3.0.0" and .................
We didn't sleep...........

@posva
Copy link
Member Author

@posva posva commented on 2c77247 May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pi0 is it all good with this version? let me know if there are issues upgrading inside Nuxt

Please sign in to comment.