Replies: 2 comments 10 replies
-
I opened a PR adding this - #2525 |
Beta Was this translation helpful? Give feedback.
-
If that's your goal, I think there are already two solutions to this problem:
you don't need suspense to use error boundaries, you can use it to wrap a component tree in an error boundary and react-query will throw errors during the next render cycle so that you can handle all errors, including fetching errors, for that sub-tree in the error boundary.
The global callbacks are documented here: https://react-query.tanstack.com/reference/QueryCache. They are only called once per query, not per observer, and cannot be overwritten (as opposed to Would either one of these solve your problem? I don't see much use for another hook that just gives you the number of erroneous queries, that doesn't seem very informative, because I won't even have access to the actual error message .... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think it would be a good idea to implement another method in
QueryClient
and a new hook.They will act in the same way as
useIsFetching
andqueryClient.isFetching
-- returning the number of currently failed queries.Why is this useful?
To have one point for all the error handling and showing one error screen for the whole application
Beta Was this translation helpful? Give feedback.
All reactions