]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: explicit values in error enum
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 19 May 2020 12:15:32 +0000 (14:15 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 19 May 2020 12:15:32 +0000 (14:15 +0200)
src/errors.ts

index 885165b0e2800e1d36dfee38a98d02b85d0ae43b..a66f0640df8f81d72395cd7d10b386e499a50e20 100644 (file)
@@ -5,12 +5,15 @@ import {
   RouteLocationNormalized,
 } from './types'
 
+/**
+ * order is important to make it backwards compatible with v3
+ */
 export const enum ErrorTypes {
-  MATCHER_NOT_FOUND,
-  NAVIGATION_GUARD_REDIRECT,
-  NAVIGATION_ABORTED,
-  NAVIGATION_CANCELLED,
-  NAVIGATION_DUPLICATED,
+  MATCHER_NOT_FOUND = 0,
+  NAVIGATION_GUARD_REDIRECT = 1,
+  NAVIGATION_ABORTED = 2,
+  NAVIGATION_CANCELLED = 3,
+  NAVIGATION_DUPLICATED = 4,
 }
 
 interface RouterErrorBase extends Error {