Error Handling

This guide shows you how to handle errors originating from the SDK. SDK by default exports the following error classes from file errors.ts

Error Hierarchy

BaseError
├── ArgumentError
├── IllegalArgumentError
├── ArgumentCountMismatchError
├── InsufficientBalanceError
├── MissingParamError
├── NoSerializerFoundError
├── RequestTimedOutError
├── TxTimedOutError
├── TypeError
├── UnsupportedPlatformError
├── UnsupportedProtocolError
├── NotImplementedError
├── UnsupportedVersionError
├── LogicError

├── InternalError
│   └── UnexpectedTsError

├── AccountError
│   └── UnavailableAccountError

├── AensError
│   ├── AensPointerContextError
│   ├── InsufficientNameFeeError
│   └── InvalidAensNameError

├── AeppError
│   ├── InvalidRpcMessageError
│   ├── MissingCallbackError
│   ├── UnAuthorizedAccountError
│   ├── UnknownRpcClientError
│   └── UnsubscribedAccountError

├── ChannelError
│   ├── ChannelCallError
│   ├── ChannelConnectionError
│   ├── ChannelPingTimedOutError
│   ├── UnexpectedChannelMessageError
│   ├── ChannelIncomingMessageError
│   └── UnknownChannelStateError

├── CompilerError
│   └── InvalidAuthDataError

├── ContractError
│   ├── BytecodeMismatchError
│   ├── DuplicateContractError
│   ├── InactiveContractError
│   ├── InvalidMethodInvocationError
│   ├── MissingContractAddressError
│   ├── MissingContractDefError
│   ├── MissingFunctionNameError
│   ├── NodeInvocationError
│   ├── NoSuchContractFunctionError
│   ├── NotPayableFunctionError
│   ├── MissingEventDefinitionError
│   └── AmbiguousEventDefinitionError

├── CryptographyError
│   ├── InvalidChecksumError
│   ├── MerkleTreeHashMismatchError
│   ├── MissingNodeInTreeError
│   ├── UnknownNodeLengthError
│   └── UnknownPathNibbleError

├── NodeError
│   ├── DuplicateNodeError
│   └── NodeNotFoundError

├── TransactionError
│   ├── DecodeError
│   ├── PayloadLengthError
│   ├── DryRunError
│   ├── IllegalBidFeeError
│   ├── InvalidSignatureError
│   ├── InvalidTxError
│   ├── PrefixNotFoundError
│   ├── SchemaNotFoundError
│   ├── TagNotFoundError
│   └── TxNotInChainError

├── WalletError
│   ├── AlreadyConnectedError
│   ├── NoWalletConnectedError
│   └── RpcConnectionError

├── RpcError
│   ├── RpcInvalidTransactionError
│   ├── RpcRejectedByUserError
│   ├── RpcUnsupportedProtocolError
│   ├── RpcConnectionDenyError
│   ├── RpcNotAuthorizeError
│   ├── RpcPermissionDenyError
│   └── RpcInternalError

Usage

Last updated

Was this helpful?