- Types
- Functions
- ActionRejectedError
- BadDataError
- BufferOverrunError
- CallExceptionError
- CancelledError
- EthersError
- InsufficientFundsError
- InvalidArgumentError
- MissingArgumentError
- NetworkError
- NonceExpiredError
- NotImplementedError
- NumericFaultError
- OffchainFaultError
- ReplacementUnderpricedError
- ServerError
- TimeoutError
- TransactionReplacedError
- UnconfiguredNameError
- UnexpectedArgumentError
- UnknownError
- UnsupportedOperationError
The action that resulted in the error.
The related transaction that caused the error.
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 simplfy programatic analysis.
_property: "UNKNOWN_ERROR" This is a general puspose fallback when no other error makes sense or the error wasn't expected
_property: "NOT_IMPLEMENTED"
Throws an EthersError with message, code and additional error info when check is falsish..
A simple helper to simply ensuring provided arguments match expected constraints, throwing if not.
In TypeScript environments, the check has been asserted true, so any further code does not need additional compile-time checks.
Throws if the normalization form is not supported.
Many classes use file-scoped values to guard the constructor, making it effectively private. This facilitates that pattern by ensuring the givenGaurd matches the file-scoped guard, throwing if not, indicating the className if provided.
Returns true if error is a CALL_EXCEPTION.
Returns true if the error matches an error thrown by ethers that matches the error code.
In TypeScript envornoments, this can be used to check that error matches an EthersError type, which means the expected properties will be set.
Returns a new Error configured to the format ethers emits errors, with the message, [[api:ErrorCode]] code and additioanl properties for the corresponding EthersError.
Each error in ethers includes the version of ethers, a machine-readable ErrorCode, and depneding on code, additional required properties. The error message will also include the meeage, ethers version, code and all aditional properties, serialized.
This Error indicates a request was rejected by the user.
In most clients (such as MetaMask), when an operation requires user authorization (such as signer.sendTransaction), the client presents a dialog box to the user. If the user denies the request this error is thrown.
The requested action.
The reason the action was rejected.
If there is already a pending request, some clients may indicate there is already a "pending" action. This prevents an app from spamming the user.
This Error indicates that a provided set of data cannot be correctly interpretted.
The data.
This Error indicates an attempt was made to read outside the bounds of protected data.
Most operations in Ethers are protected by bounds checks, to mitigate exploits when parsing data.
The buffer that was overrun.
The length of the buffer.
The offset that was requested.
This Error indicates a transaction reverted.
The action being performed when the revert was encountered.
The revert data returned.
The contract invocation details, if available.
A human-readable representation of data, if possible.
The built-in or custom revert error, if available
The transaction that triggered the exception.
This Error indicates that the operation was cancelled by a programmatic call, for example to cancel().
All errors in Ethers include properties to assist in machine-readable errors.
Any related error.
Additional info regarding the error that may be useful.
This is generally helpful mostly for human-based debugging.
The sending account has insufficient funds to cover the entire transaction cost.
The transaction.
This Error indicates an incorrect type or value was passed to a function or method.
The name of the argument.
The value that was provided.
This Error indicates there were too few arguments were provided.
The number of arguments received.
The number of arguments expected.
The sending account has already used this nonce in a transaction that has been included.
The transaction.
This Error is mostly used as a stub for functionality that is intended for the future, but is currently not implemented.
The attempted operation.
This Error indicates an operation which would result in incorrect arithmetic output has occurred.
For example, trying to divide by zero or using a uint8 to store a negative value.
The fault reported.
The attempted operation.
The value the operation was attempted against.
A CCIP-read exception, which cannot be recovered from or be further processed.
The reason the CCIP-read failed.
The transaction.
An attempt was made to replace a transaction, but with an insufficient additional fee to afford evicting the old transaction from the memory pool.
The transaction.
This Error indicates there was a problem fetching a resource from a server.
The requested resource.
The response received from the server, if available.
This Error indicates that the timeout duration has expired and that the operation has been implicitly cancelled.
The side-effect of the operation may still occur, as this generally means a request has been sent and there has simply been no response to indicate whether it was processed or not.
The attempted operation.
The reason.
The resource request, if available.
A pending transaction was replaced by another.
If the transaction was cancelled, such that the original effects of the transaction cannot be assured.
The hash of the replaced transaction.
The reason the transaction was replaced.
The receipt of the transaction that replace the transaction.
The transaction that replaced the transaction.
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 Zero.
The ENS name that was requested
This Error indicates too many arguments were provided.
The number of arguments received.
The number of arguments expected.
This Error is a catch-all for when there is no way for Ethers to know what the underlying problem is.