Skip to content
IC Reactor

ReactorErrorOf

ReactorErrorOf<R, M> = ReactorReturnErr<ServiceOf<R>, M, TransformOf<R>>

Defined in: core/src/types/reactor.ts:377

The errors a call of a reactor’s method rejects with: a CanisterError holding the Err value of its Candid Result in the reactor’s own form, a CallError or a ValidationError. It is ReactorReturnErr<Service, M, Transform> with the service and transform read from typeof reactor, and the type a hook’s error holds.

R extends object

The reactor’s type, as typeof reactor.

M extends FunctionName<ServiceOf<R>>

The method.

const ledger = new DisplayReactor<Ledger>({ clientManager, name: "ledger", idlFactory })
type TransferError = ReactorErrorOf<typeof ledger, "icrc1_transfer">
function describe(error: TransferError): string {
if (isCanisterError(error)) return error.code // "InsufficientFunds", ...
return error.message
}