vue-query useMutation() throws on error regardless of the throwOnError/useErrorBoundary value #7206
Unanswered
douglasg14b
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Could you please clarify the behavior you are expecting? Alternatively, could you provide an example of the minimal output you're looking for? I wanted to point out that if an error occurs within const { mutate } = useMutation({
mutationFn() {
return new Promise((_, reject) => {
setTimeout(() => reject('error'), 300);
});
},
onError() {
console.log('error');
},
throwOnError: true,
}); I hope this helps clarify the issue. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't seem to figure out how to get vue-query to not throw on errors, the docs indicate that using
throwOnError: false
in the options should prevent this, but the behavior does not change as this value changes. (The same foruseErrorBoundary
)In extra confusion, the typings for the mutation options shows
useErrorBoundary
and notthrowOnError
, however the v5 docs indicate thatuseErrorBoundary
has been deprecated.I'm on
1.26.0
andvue 3.4.21
Beta Was this translation helpful? Give feedback.
All reactions