Are the errors in onSuccess callback are catch ?
Hello everyone,
I have a pretty simple question but i can't find the answer.
Imagine i have something like that:
invalidate could throw an error if for whatever reason it failed no ?
And in this case, is the error catch or should wrap the invalidateQueries inside a try/catch ?
Thanks for your help 🙂
3 Replies
dependent-tan•3y ago
invalidateQueries doesn't throw errors, so no try/catch needed
conscious-sapphireOP•3y ago
oh ok x) i was not sure about that, thanks for your response
i was thinking that beacause in type definition invalidateQueries return Promise<void> so i assumed it could throw
ok i see, it only throw if i pass throwOnError: true
dependent-tan•3y ago
Yeah it does .catch(noop) per default