MCPcopy Create free account
hub / github.com/TanStack/query / shouldThrowError

Function shouldThrowError

packages/query-core/src/utils.ts:464–474  ·  view source on GitHub ↗
(
  throwOnError: boolean | T | undefined,
  params: Parameters<T>,
)

Source from the content-addressed store, hash-verified

462}
463
464export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
465 throwOnError: boolean | T | undefined,
466 params: Parameters<T>,
467): boolean {
468 // Allow throwOnError function to override throwing behavior on a per-error basis
469 if (typeof throwOnError === 'function') {
470 return throwOnError(...params)
471 }
472
473 return !!throwOnError
474}
475
476export function addConsumeAwareSignal<T>(
477 object: T,

Callers 13

runFunction · 0.90
useBaseQueryFunction · 0.90
useMutationFunction · 0.90
useMutationFunction · 0.90
getHasErrorFunction · 0.90
createBaseQueryFunction · 0.90
injectMutationFunction · 0.90
useMutationFunction · 0.90
getHasErrorFunction · 0.90
useBaseQueryFunction · 0.90
useMutationFunction · 0.90

Calls 1

throwOnErrorFunction · 0.50

Tested by

no test coverage detected