MCPcopy
hub / github.com/TanStack/query / shouldThrowError

Function shouldThrowError

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

Source from the content-addressed store, hash-verified

444}
445
446export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
447 throwOnError: boolean | T | undefined,
448 params: Parameters<T>,
449): boolean {
450 // Allow throwOnError function to override throwing behavior on a per-error basis
451 if (typeof throwOnError === 'function') {
452 return throwOnError(...params)
453 }
454
455 return !!throwOnError
456}

Callers 10

runFunction · 0.90
useBaseQueryFunction · 0.90
useMutationFunction · 0.90
useMutationFunction · 0.90
getHasErrorFunction · 0.90
createBaseQueryFunction · 0.90
injectMutationFunction · 0.90
useBaseQueryFunction · 0.90
useMutationFunction · 0.90
utils.test.tsxFile · 0.90

Calls 1

throwOnErrorFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…