Class ContractDispatchError<ContractApi>

Represents an error that occurred during the execution of a smart contract call due to a dispatch error. This class extends ContractExecutionError and includes a DispatchError property.

Type Parameters

Hierarchy (view full)

Constructors

  • Constructs a new ContractDispatchError instance.

    Type Parameters

    Parameters

    • err:
          | {
              type: "CannotLookup";
          }
          | {
              type: "Other";
          }
          | {
              type: "BadOrigin";
          }
          | {
              type: "Module";
              value: {
                  error: `0x${string}`;
                  index: number;
              };
          }
          | {
              type: "ConsumerRemaining";
          }
          | {
              type: "NoProviders";
          }
          | {
              type: "TooManyConsumers";
          }
          | {
              type: "Token";
              value:
                  | "FundsUnavailable"
                  | "OnlyProvider"
                  | "BelowMinimum"
                  | "CannotCreate"
                  | "UnknownAsset"
                  | "Frozen"
                  | "Unsupported"
                  | "CannotCreateHold"
                  | "NotExpendable"
                  | "Blocked";
          }
          | {
              type: "Arithmetic";
              value: "Underflow" | "Overflow" | "DivisionByZero";
          }
          | {
              type: "Transactional";
              value: "LimitReached" | "NoLayer";
          }
          | {
              type: "Exhausted";
          }
          | {
              type: "Corruption";
          }
          | {
              type: "Unavailable";
          }
          | {
              type: "RootNotAllowed";
          }

      The DispatchError that occurred during the dispatch phase.

    • raw: ContractCallResult<ContractApi["types"]["ChainApi"]>

      The raw result of the contract call.

    Returns ContractDispatchError<ContractApi>

Properties

cause?: unknown
dispatchError:
    | {
        type: "CannotLookup";
    }
    | {
        type: "Other";
    }
    | {
        type: "BadOrigin";
    }
    | {
        type: "Module";
        value: {
            error: `0x${string}`;
            index: number;
        };
    }
    | {
        type: "ConsumerRemaining";
    }
    | {
        type: "NoProviders";
    }
    | {
        type: "TooManyConsumers";
    }
    | {
        type: "Token";
        value:
            | "FundsUnavailable"
            | "OnlyProvider"
            | "BelowMinimum"
            | "CannotCreate"
            | "UnknownAsset"
            | "Frozen"
            | "Unsupported"
            | "CannotCreateHold"
            | "NotExpendable"
            | "Blocked";
    }
    | {
        type: "Arithmetic";
        value: "Underflow" | "Overflow" | "DivisionByZero";
    }
    | {
        type: "Transactional";
        value: "LimitReached" | "NoLayer";
    }
    | {
        type: "Exhausted";
    }
    | {
        type: "Corruption";
    }
    | {
        type: "Unavailable";
    }
    | {
        type: "RootNotAllowed";
    }

The error that occurred during the dispatch phase.

message: string
name: string = 'ContractDispatchError'
raw: Awaited<ReturnType<ContractApi["types"]["ChainApi"]["call"]["contractsApi"]["call"]>>

The raw result of the contract call.

stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void