onError global guard doesn't seem to catch all the errors #2101
-
I've noticed a problem with Screen.Recording.2024-01-05.at.17.57.33.movI'm not sure if this is a bug or just that the errors aren't supposed to be thrown/handled this way in vue router. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
The onError triggers both times (you have 2 logs of it). You see the red log from the router.push() which will also reject the promise it returns but router-links cannot be caught so it catches the internal call of router.push() it does |
Beta Was this translation helpful? Give feedback.
I think you do not mean to throw an Error in that case as that is for unexpected errors and it is meant to be caught by things like sentry.
That being said you could always create your custom push function that always adds a
catch()
at the end