errors

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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_PAYMASTER = -32504
	INVALID_PAYMASTER_STAKE       = -32505
	INVALID_AGGREGATOR            = -32506
	INVALID_SIGNATURE             = -32507
	INVALID_FIELDS                = -32602

	EXECUTION_REVERTED = -32521
)

Functions

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