All errors in ethers include properties to ensure they are both human-readable (i.e. .message) and machine-readable (i.e. .code).
The isError function can be used to check the error code and provide a type guard for the properties present on that error interface.
A conditional type that transforms the ErrorCode T into its EthersError type.
All errors emitted by ethers have an ErrorCode to help identify and coalesce errors to simplify programmatic analysis.
Each ErrorCode is the code proerty of a coresponding EthersError.
"UNKNOWN_ERROR" - see UnknownError
"NOT_IMPLEMENTED" - see NotImplementedError
"UNSUPPORTED_OPERATION" - see UnsupportedOperationError
"NETWORK_ERROR" - see NetworkError
"SERVER_ERROR" - see ServerError
"TIMEOUT" - see TimeoutError
"BAD_DATA" - see BadDataError
"CANCELLED" - see CancelledError
"BUFFER_OVERRUN" - see BufferOverrunError
"NUMERIC_FAULT" - see NumericFaultError
"INVALID_ARGUMENT" - see InvalidArgumentError
"MISSING_ARGUMENT" - see MissingArgumentError
"UNEXPECTED_ARGUMENT" - see UnexpectedArgumentError
"CALL_EXCEPTION" - see CallExceptionError
"INSUFFICIENT_FUNDS" - see InsufficientFundsError
"NONCE_EXPIRED" - see NonceExpiredError
"REPLACEMENT_UNDERPRICED" - see ReplacementUnderpricedError
"TRANSACTION_REPLACED" - see TransactionReplacedError
"UNCONFIGURED_NAME" - see UnconfiguredNameError
"OFFCHAIN_FAULT" - see OffchainFaultError
"ACTION_REJECTED" - see ActionRejectedError
Returns a new Error configured to the format ethers emits errors, with the message, [[api:ErrorCode]] code and additional properties for the corresponding EthersError.
Each error in ethers includes the version of ethers, a machine-readable ErrorCode, and depending on code, additional required properties. The error message will also include the message, ethers version, code and all additional properties, serialized.
This Error indicates an ENS name was used, but the name has not been configured.
This could indicate an ENS name is unowned or that the current address being pointed to is the ZeroAddress.