Skip to content

Commit c70058d

Browse files
committed
Update docs/guide/advanced/navigation-failures.md
1 parent 09ee0e2 commit c70058d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guide/advanced/navigation-failures.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When using `router-link`, Vue Router internally calls `router.push` to trigger a
44

55
- We are already on the page we are trying to go to
66
- A navigation guard aborts the navigation by calling `next(false)`
7-
- An error is thrown in a navigation by calling `next(new Error())`
7+
- A navigation guard throws an error or calls `next(new Error())`
88

99
When using a regular `router-link`, **none of these failures will log an error**. However, if you are using `router.push` or `router.replace`, you might come across an _"Uncaught (in promise) Error"_ message followed by a more specific message in your console. This is part of the _Navigation Failures_ system in Vue Router and it is only available from version 3.2.0 onwards but existed for a long time before: through the two optional callbacks, `onComplete` and `onAbort` that can be passed to `router.push`. Since version 3.1.0, `router.push` and `router.replace` return a _Promise_ if no `onComplete`/`onAbort` callback is provided. This _Promise_ resolves instead of invoking `onComplete` and rejects instead of invoking `onAbort`.
1010

0 commit comments

Comments
 (0)