#propagating errors to global error boundary

11 messages · Page 1 of 1 (latest)

swift ruin
#

I am running a queryClient.fetchQuery inside of an onChange validator... when it throws a server error, I want it to use my global error boundary, but I'm noticing that it's getting swallowed and is just getting set to the localized error object, is there a way around this?

swift ruin
#

it looks like onSubmit will propagate errors to the global error boundary, but granular validation functions will not

#

propagating errors to global error boundary

storm kestrel
swift ruin
#

soooo

#TIL that queryClient.fetchQuery throwing does not propagate to global boundaries

#

that's my actual issue.. nothing to do with tanstack form!

storm kestrel
swift ruin
#

Ya gotta wrap it in a useMutation

#

Or do useQuery with enabled false and trigger later

chilly wedge
# swift ruin soooo #TIL that queryClient.fetchQuery throwing does not propagate to global bo...

That does not sound right...

https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery

It will either resolve with the data or throw with the error.

Why wouldn't it propagate up to the nearest error boundary

QueryClient The QueryClient can be used to interact with a cache: tsx import { QueryClient } from '@tanstack/react-query' const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime:...

swift ruin
#

Maybe it’s an issue with how I have error handling configured