Skip to content
IC Reactor

isRetryableReactorError

isRetryableReactorError(error): boolean

Defined in: errors/index.ts:296

Whether retrying a failed canister call could plausibly produce a different result.

The rule is “retry only what the agent reports as a condition that could differ next time”. Concretely:

  • CanisterError — the canister returned an Err variant. Never.
  • ValidationError — refused by a validator client-side. Never.
  • CallErrorReactor.callMethod wraps everything else in one of these, including our own Candid encode/decode and transform failures, so the wrapper alone says nothing. The decision comes from the cause:
    • an agent error (it carries a kind): retried, except for a rejection whose reject code is one the replica will simply repeat;
    • anything else: not retried, because no agent error means no request was ever made — the failure happened in encoding, decoding or transforming, and the identical input produces the identical failure.
  • any other error: not retried, for the same reason.

Within agent errors the bias is toward retrying: an unrecognised kind, or a rejection whose code cannot be read, still retries, so an unfamiliar transport-level fault is never silently made fatal.

unknown

boolean

Opt in on a QueryClient you construct yourself

new QueryClient({
defaultOptions: { queries: { retry: reactorRetry } },
})