T
TanStack2y ago
flat-fuchsia

Error handling

Hi guys! I want to throw for second call when http response code is 500 const {data, isLoading, refetch, fetchNextPage} = useGetDeckSuspenseInfiniteQuery() Steps to reproducate: 1. Load list: http 200 2. Change backend code to get http 500 3. Refrech list (called refetch, http code is 500) It throws when first list load is http 500 But it not throws error because there is a previous data. How can I throw it? What missing? Thank you !
No description
No description
No description
No description
2 Replies
flat-fuchsia
flat-fuchsiaOP2y ago
also there is an axios interceptor to handle http 401 later
No description
flat-fuchsia
flat-fuchsiaOP2y ago
React Query Error Handling
After covering the sunshine cases of data fetching, it's time to look at situations where things don't go as planned and "Something went wrong..."

Did you find this page helpful?