Skip to content
IC Reactor

ReactorError

ReactorError<E> = [E] extends [never] ? ReactorErrorBase & object : ReactorErrorBase & { kind: Exclude<ReactorErrorKind, "canister_err">; err?: undefined; } | { kind: "canister_err"; err: E; }

Defined in: core/src/errors.ts:110

The error every ic-reactor call rejects with.

Narrow on kind. For a method whose result has an Err arm, E is that arm’s type, and err is typed E exactly when kind is "canister_err" (and undefined for every other kind). E defaults to never, which stands for a method without an Err arm: err is then always undefined.

E = never

try {
await ledger.icrc1_transfer(args)
} catch (e) {
if (isReactorError(e) && e.mayHaveExecuted) {
// Do not re-send: read the balance back first.
}
}