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,


I thought I could use isError and error return by the useQuery hook to handle the error
something like
if (isError) console.log(error)


But still getting an unhandaled Promise rejection for that error. So seems I am not really
"handling it locally"
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..."
React Query Error Handling
Was this page helpful?