errors

package
v0.36.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndpointNotSupported = errors.New("endpoint is not supported")
	ErrRateLimit            = errors.New("limit of requests per second reached")
	ErrIndexOnlyMode        = errors.New("transaction submission not allowed in index-only mode")

	ErrInternal            = errors.New("internal error")
	ErrInvalid             = errors.New("invalid")
	ErrRecoverable         = errors.New("recoverable")
	ErrDisconnected        = NewRecoverableError(errors.New("disconnected"))
	ErrMissingBlock        = errors.New("missing block")
	ErrMissingTransactions = errors.New("missing transactions")

	ErrFailedTransaction  = errors.New("failed transaction")
	ErrInvalidTransaction = fmt.Errorf("%w: %w", ErrInvalid, ErrFailedTransaction)

	// ErrStorageNotInitialized indicates storage instance was not correctly initialized and contains empty required values.
	ErrStorageNotInitialized = errors.New("storage not initialized")
	// ErrEntityNotFound indicates the resource does not exist.
	ErrEntityNotFound = errors.New("entity not found")
	// ErrInvalidBlockRange indicates that the block range provided as start and end height is invalid.
	ErrInvalidBlockRange = fmt.Errorf("%w %w", ErrInvalid, errors.New("block height range"))
	// ErrHeightOutOfRange indicates the requested height is out of available range
	ErrHeightOutOfRange = fmt.Errorf("%w %w", ErrInvalid, errors.New("height not in available range"))
)

Functions

func NewEndpointNotSupportedError added in v0.29.3

func NewEndpointNotSupportedError(endpoint string) error

func NewFailedTransactionError added in v0.29.3

func NewFailedTransactionError(reason string) error

func NewHeightOutOfRangeError added in v0.29.3

func NewHeightOutOfRangeError(height uint64) error

func NewInvalidTransactionError added in v0.29.3

func NewInvalidTransactionError(err error) error

func NewRecoverableError added in v0.29.3

func NewRecoverableError(err error) error

func NewTxGasPriceTooLowError added in v0.29.3

func NewTxGasPriceTooLowError(gasPrice *big.Int) error

Types

type RevertError

type RevertError struct {
	Reason string // revert reason hex encoded
	// contains filtered or unexported fields
}

RevertError is an API error that encompasses an EVM revert with JSON error code and a binary data blob. We need this custom error type defined because the Geth server implementation expects this type when serialising the error API response.

func NewRevertError

func NewRevertError(revert []byte) *RevertError

NewRevertError creates a revertError instance with the provided revert data.

func (*RevertError) ErrorCode

func (e *RevertError) ErrorCode() int

ErrorCode returns the JSON error code for a revert. See: https://github.com/ethereum/wiki/wiki/JSON-RPC-Error-Codes-Improvement-Proposal

func (*RevertError) ErrorData

func (e *RevertError) ErrorData() interface{}

ErrorData returns the hex encoded revert reason.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL