Skip to content

Commit ccb120e

Browse files
committed
refactor: explicit values in error enum
1 parent 60b65f4 commit ccb120e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/errors.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import {
55
RouteLocationNormalized,
66
} from './types'
77

8+
/**
9+
* order is important to make it backwards compatible with v3
10+
*/
811
export const enum ErrorTypes {
9-
MATCHER_NOT_FOUND,
10-
NAVIGATION_GUARD_REDIRECT,
11-
NAVIGATION_ABORTED,
12-
NAVIGATION_CANCELLED,
13-
NAVIGATION_DUPLICATED,
12+
MATCHER_NOT_FOUND = 0,
13+
NAVIGATION_GUARD_REDIRECT = 1,
14+
NAVIGATION_ABORTED = 2,
15+
NAVIGATION_CANCELLED = 3,
16+
NAVIGATION_DUPLICATED = 4,
1417
}
1518

1619
interface RouterErrorBase extends Error {

0 commit comments

Comments
 (0)