File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
export class NavigationDuplicated extends Error {
2
- constructor ( ) {
3
- super ( 'Navigating to current location is not allowed' )
2
+ constructor ( normalizedLocation ) {
3
+ super ( )
4
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
5
18
}
6
19
}
7
20
You can’t perform that action at this time.
0 commit comments