errors

package
v0.0.0-...-24d451d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstOnly

func FirstOnly() *singleError

Types

type CallError

type CallError struct {
	// The error from the original call which defines the overall error code
	CodedError
	// Errors from nested sub-calls of the original call that may have also occurred
	NestedErrors []NestedCallError
}

func (CallError) Error

func (err CallError) Error() string

type Code

type Code uint32
const (
	ErrorCodeGeneric Code = iota
	ErrorCodeUnknownAddress
	ErrorCodeInsufficientBalance
	ErrorCodeInvalidJumpDest
	ErrorCodeInsufficientGas
	ErrorCodeMemoryOutOfBounds
	ErrorCodeCodeOutOfBounds
	ErrorCodeInputOutOfBounds
	ErrorCodeReturnDataOutOfBounds
	ErrorCodeCallStackOverflow
	ErrorCodeCallStackUnderflow
	ErrorCodeDataStackOverflow
	ErrorCodeDataStackUnderflow
	ErrorCodeInvalidContract
	ErrorCodeNativeContractCodeCopy
	ErrorCodeExecutionAborted
	ErrorCodeExecutionReverted
	ErrorCodePermissionDenied
	ErrorCodeNativeFunction
	ErrorCodeEventPublish
	ErrorCodeInvalidString
	ErrorCodeEventMapping
	ErrorCodeInvalidAddress
	ErrorCodeDuplicateAddress
	ErrorCodeInsufficientFunds
	ErrorCodeOverpayment
	ErrorCodeZeroPayment
	ErrorCodeInvalidSequence
	ErrorCodeReservedAddress
	ErrorCodeIllegalWrite
	ErrorCodeIntegerOverflow
	ErrorCodeInvalidProposal
	ErrorCodeExpiredProposal
	ErrorCodeProposalExecuted
	ErrorCodeNoInputPermission
	ErrorCodeInvalidBlockNumber
	ErrorCodeBlockNumberOutOfRange
	ErrorCodeAlreadyVoted
	ErrorCodeUnresolvedSymbols
)

func (Code) Error

func (c Code) Error() string

func (Code) ErrorCode

func (c Code) ErrorCode() Code

func (Code) String

func (c Code) String() string

func (Code) Uint32

func (c Code) Uint32() uint32

type CodedError

type CodedError interface {
	error
	ErrorCode() Code
	String() string
}

type Exception

type Exception struct {
	Code      Code   `json:"Code,omitempty"`
	Exception string `json:"Exception,omitempty"`
}

func AsException

func AsException(err error) *Exception

Wraps any error as a Exception

func ErrorCodef

func ErrorCodef(errorCode Code, format string, a ...interface{}) *Exception

func Errorf

func Errorf(format string, a ...interface{}) *Exception

func NewException

func NewException(errorCode Code, exception string) *Exception

func Wrap

func Wrap(err error, message string) *Exception

func (*Exception) AsError

func (e *Exception) AsError() error

func (*Exception) Equal

func (e *Exception) Equal(ce CodedError) bool

func (*Exception) Error

func (e *Exception) Error() string

func (*Exception) ErrorCode

func (e *Exception) ErrorCode() Code

func (*Exception) String

func (e *Exception) String() string

type NestedCallError

type NestedCallError struct {
	CodedError
	Caller     types.Address
	Callee     types.Address
	StackDepth uint64
}

func (NestedCallError) Error

func (err NestedCallError) Error() string

type Provider

type Provider interface {
	// Returns the an error if errors occurred some execution or nil if none occurred
	Error() CodedError
}

type Sink

type Sink interface {
	PushError(error)
}

Jump to

Keyboard shortcuts

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