errors

package
v0.6.47 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REJECTED_BY_EP_OR_ACCOUNT  = -32500
	REJECTED_BY_PAYMASTER      = -32501
	BANNED_OPCODE              = -32502
	SHORT_DEADLINE             = -32503
	BANNED_OR_THROTTLED_ENTITY = -32504
	INVALID_ENTITY_STAKE       = -32505
	INVALID_AGGREGATOR         = -32506
	INVALID_SIGNATURE          = -32507
	INVALID_FIELDS             = -32602

	EXECUTION_REVERTED = -32521
)

Functions

func DecodePanic added in v0.6.14

func DecodePanic(data []byte) (string, error)

func DecodeRevert added in v0.6.0

func DecodeRevert(data []byte) (string, error)

func NewRPCError

func NewRPCError(code int, message string, data any) error

New returns a new custom RPCError.

func ParseHexToRpcDataError added in v0.6.0

func ParseHexToRpcDataError(hex string) (rpc.DataError, error)

ParseHexToRpcDataError is a utility function that converts a hex string into an interface that's compatible with rpc.DataError. This is useful for parsing output from a debug_traceCall that resulted in a transaction revert.

Types

type RPCError

type RPCError struct {
	// contains filtered or unexported fields
}

RPCError is a custom error that fits the JSON-RPC error spec.

func (*RPCError) Code

func (e *RPCError) Code() int

Code returns the code field of the JSON-RPC error object.

func (*RPCError) Data

func (e *RPCError) Data() any

Data returns the data field of the JSON-RPC error object.

func (*RPCError) Error

func (e *RPCError) Error() string

Code returns the message field of the JSON-RPC error object.

Jump to

Keyboard shortcuts

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