ape.exceptions

exception ape.exceptions.AccountsError(message)

Bases: ape.exceptions.ApeException

Raised when a problem occurs when using accounts.

exception ape.exceptions.AddressError(message)

Bases: ape.exceptions.ApeException

Raised when a problem occurs regarding an address.

exception ape.exceptions.AliasAlreadyInUseError(alias: str)

Bases: ape.exceptions.AccountsError

Raised when attempting to add an account using an alias that already maps to another account.

exception ape.exceptions.ApeException(message)

Bases: Exception

An exception raised by ape.

exception ape.exceptions.ArgumentsLengthError

Bases: ape.exceptions.ContractError

Raised when calling a contract method with the wrong number of arguments.

exception ape.exceptions.ChainError(message)

Bases: ape.exceptions.ApeException

Raised when problems occur in the ChainManager.

exception ape.exceptions.CompilerError(message)

Bases: ape.exceptions.ApeException

Raised when unable to compile.

exception ape.exceptions.ConfigError(message)

Bases: ape.exceptions.ApeException

Raised when a problem occurs from the configuration file.

exception ape.exceptions.ContractDeployError(base_err: Optional[Exception] = None, message: Optional[str] = None, code: Optional[int] = None)

Bases: ape.exceptions.TransactionError

Raised when a problem occurs when deploying a contract.

exception ape.exceptions.ContractError(message)

Bases: ape.exceptions.ApeException

Raised when issues occur when interacting with a contract (calls or transactions).

exception ape.exceptions.ContractLogicError(revert_message: Optional[str] = None)

Bases: ape.exceptions.VirtualMachineError

Raised when there is a contract-defined revert, such as from an assert/require statement.

classmethod from_error(err: Exception)

Creates this class from the error message of the given error.

This should be overridden whenever possible to handle provider-specific use-cases for raising this error.

exception ape.exceptions.ConversionError(message)

Bases: ape.exceptions.ApeException

Raised when unable to convert a value.

exception ape.exceptions.DecodingError

Bases: ape.exceptions.ContractError

Raised when issues occur while decoding data from a contract call or transaction.

exception ape.exceptions.NetworkError(message)

Bases: ape.exceptions.ApeException

Raised when a problem occurs when using blockchain networks.

exception ape.exceptions.NetworkNotFoundError(network: str)

Bases: ape.exceptions.NetworkError

Raised when the network with the given name was not found.

exception ape.exceptions.OutOfGasError(code: Optional[int] = None)

Bases: ape.exceptions.TransactionError

Raised when detecting a transaction failed because it ran out of gas.

exception ape.exceptions.ProjectError(message)

Bases: ape.exceptions.ApeException

Raised when problems occur in a project.

exception ape.exceptions.ProviderError(message)

Bases: ape.exceptions.ApeException

Raised when a problem occurs when using providers.

exception ape.exceptions.ProviderNotConnectedError

Bases: ape.exceptions.ProviderError

Raised when not connected to a provider.

exception ape.exceptions.SignatureError(message)

Bases: ape.exceptions.AccountsError

Raised when there are issues with signing.

exception ape.exceptions.TransactionError(base_err: Optional[Exception] = None, message: Optional[str] = None, code: Optional[int] = None)

Bases: ape.exceptions.ContractError

Raised when issues occur related to transactions.

exception ape.exceptions.UnknownSnapshotError(snapshot_id: SnapshotID)

Bases: ape.exceptions.ChainError

Raised when given an unknown snapshot ID.

exception ape.exceptions.VirtualMachineError(base_err: Optional[Exception] = None, message: Optional[str] = None, code: Optional[int] = None)

Bases: ape.exceptions.TransactionError

Raised when a transaction error occurs in a virtual machine.