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

Function shouldThrowError

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

Source from the content-addressed store, hash-verified

477}
478
479export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
480 throwOnError: boolean | T | undefined,
481 params: Parameters<T>,
482): boolean {
483 // Allow throwOnError function to override throwing behavior on a per-error basis
484 if (typeof throwOnError === 'function') {
485 return throwOnError(...params)
486 }
487
488 return !!throwOnError
489}
490
491export function addConsumeAwareSignal<T>(
492 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