We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As a developer, I need to capture all navigation failure globally, not for one single navigation.
so, $router.push('xxx').catch(...) is not a solution.
$router.push('xxx').catch(...)
For now, I have to hack to prototype to archive it.
const originalPush = VueRouter.prototype.push; VueRouter.prototype.push = function (location: any) { return originalPush.bind(this)(location).catch((err) => { NProgress.done(); return err; }); };
VueRouter.prototype.onAbort = function() { ... }
BTW, there was a similar issue, which was closed casually. #3286
The text was updated successfully, but these errors were encountered:
But why?
I can see the value in never throwing an error, often the unnecessary .catch(() => {}) has to be added.
.catch(() => {})
I wourd be more interested in never throwing, or logging an Vue message using the Vue global message handlers.
Vue
Sorry, something went wrong.
See #2881 (comment) on how to replicate the existing behavior on Vue Router 4. This can be added as it would be a breaking change
No branches or pull requests
What problem does this feature solve?
As a developer, I need to capture all navigation failure globally, not for one single navigation.
so,
$router.push('xxx').catch(...)
is not a solution.For now, I have to hack to prototype to archive it.
What does the proposed API look like?
BTW, there was a similar issue, which was closed casually.
#3286
The text was updated successfully, but these errors were encountered: