T
TanStack3y ago
rising-crimson

How do I handle errors locally?

How do I handle errors locally? I am looking here. https://tkdodo.eu/blog/react-query-error-handling I have my query setup with this
useErrorBoundary: (error) => error.response?.status >= 500,
useErrorBoundary: (error) => error.response?.status >= 500,
I thought I could use isError and error return by the useQuery hook to handle the error something like
if (isError) console.log(error)
if (isError) console.log(error)
But still getting an unhandaled Promise rejection for that error. So seems I am not really "handling it locally"
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..."
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?