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

Function shouldThrowError

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

Source from the content-addressed store, hash-verified

580 * ```
581 */
582export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
583 throwOnError: boolean | T | undefined,
584 params: Parameters<T>,
585): boolean {
586 // Allow throwOnError function to override throwing behavior on a per-error basis
587 if (typeof throwOnError === 'function') {
588 return throwOnError(...params)
589 }
590
591 return !!throwOnError
592}
593
594export function addConsumeAwareSignal<T>(
595 object: T,

Callers 15

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