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

Function shouldThrowError

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

Source from the content-addressed store, hash-verified

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

Callers 14

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

Calls 1

throwOnErrorFunction · 0.50

Tested by

no test coverage detected