We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5141def commit 5ef5d73Copy full SHA for 5ef5d73
src/history/errors.js
@@ -1,7 +1,20 @@
1
export class NavigationDuplicated extends Error {
2
- constructor () {
3
- super('Navigating to current location is not allowed')
+ constructor (normalizedLocation) {
+ super()
4
this.name = this._name = 'NavigationDuplicated'
5
+ // passing the message to super() doesn't seem to work in the transpiled version
6
+ this.message = `Navigating to current location ("${
7
+ normalizedLocation.fullPath
8
+ }") is not allowed`
9
+ // add a stack property so services like Sentry can correctly display it
10
+ Object.defineProperty(this, 'stack', {
11
+ value: new Error().stack,
12
+ writable: true,
13
+ configurable: true
14
+ })
15
+ // we could also have used
16
+ // Error.captureStackTrace(this, this.constructor)
17
+ // but it only exists on node and chrome
18
}
19
20
0 commit comments