errors

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	CallError    CodedError
	NestedErrors []NestedCall
}

func (Call) Error

func (err Call) Error() string

func (Call) ErrorCode

func (err Call) ErrorCode() Code

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
)

func (Code) Error

func (c Code) Error() string

func (Code) ErrorCode

func (c Code) ErrorCode() Code

type CodedError

type CodedError interface {
	error
	ErrorCode() Code
}

func ErrorCodef

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

func Errorf

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

type ErrorCode

type ErrorCode struct {
	Code                 uint32   `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewErrorCode

func NewErrorCode(code Code) *ErrorCode

func (*ErrorCode) Descriptor

func (*ErrorCode) Descriptor() ([]byte, []int)

func (*ErrorCode) GetCode

func (m *ErrorCode) GetCode() uint32

func (ErrorCode) MarshalJSON

func (e ErrorCode) MarshalJSON() ([]byte, error)

func (*ErrorCode) ProtoMessage

func (*ErrorCode) ProtoMessage()

func (*ErrorCode) Reset

func (m *ErrorCode) Reset()

func (*ErrorCode) String

func (m *ErrorCode) String() string

func (*ErrorCode) UnmarshalJSON

func (e *ErrorCode) UnmarshalJSON(bs []byte) error

func (*ErrorCode) XXX_DiscardUnknown

func (m *ErrorCode) XXX_DiscardUnknown()

func (*ErrorCode) XXX_Marshal

func (m *ErrorCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ErrorCode) XXX_Merge

func (dst *ErrorCode) XXX_Merge(src proto.Message)

func (*ErrorCode) XXX_Size

func (m *ErrorCode) XXX_Size() int

func (*ErrorCode) XXX_Unmarshal

func (m *ErrorCode) XXX_Unmarshal(b []byte) error

type Exception

type Exception struct {
	Code                 *ErrorCode `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Exception            string     `protobuf:"bytes,2,opt,name=Exception,proto3" json:"Exception,omitempty"`
	BS                   []byte     `protobuf:"bytes,3,opt,name=BS,proto3" json:"BS,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func AsCodedError

func AsCodedError(err error) *Exception

Wraps any error as a Exception

func NewCodedError

func NewCodedError(errorCode Code, exception string) *Exception

func Wrap

func Wrap(err CodedError, message string) *Exception

func (*Exception) AsError

func (e *Exception) AsError() error

func (*Exception) Descriptor

func (*Exception) Descriptor() ([]byte, []int)

func (*Exception) Error

func (e *Exception) Error() string

func (*Exception) ErrorCode

func (e *Exception) ErrorCode() Code

func (*Exception) GetBS

func (m *Exception) GetBS() []byte

func (*Exception) GetCode

func (m *Exception) GetCode() *ErrorCode

func (*Exception) GetException

func (m *Exception) GetException() string

func (*Exception) ProtoMessage

func (*Exception) ProtoMessage()

func (*Exception) Reset

func (m *Exception) Reset()

func (*Exception) String

func (m *Exception) String() string

func (*Exception) XXX_DiscardUnknown

func (m *Exception) XXX_DiscardUnknown()

func (*Exception) XXX_Marshal

func (m *Exception) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Exception) XXX_Merge

func (dst *Exception) XXX_Merge(src proto.Message)

func (*Exception) XXX_Size

func (m *Exception) XXX_Size() int

func (*Exception) XXX_Unmarshal

func (m *Exception) XXX_Unmarshal(b []byte) error

type LacksSNativePermission

type LacksSNativePermission struct {
	Address crypto.Address
	SNative string
}

func (LacksSNativePermission) Error

func (e LacksSNativePermission) Error() string

func (LacksSNativePermission) ErrorCode

func (e LacksSNativePermission) ErrorCode() Code

type NestedCall

type NestedCall struct {
	NestedError CodedError
	Caller      crypto.Address
	Callee      crypto.Address
	StackDepth  uint64
}

func (NestedCall) Error

func (err NestedCall) Error() string

func (NestedCall) ErrorCode

func (err NestedCall) ErrorCode() Code

type PermissionDenied

type PermissionDenied struct {
	Perm types.PermFlag
}

func (PermissionDenied) Error

func (err PermissionDenied) Error() string

func (PermissionDenied) ErrorCode

func (err PermissionDenied) ErrorCode() Code

Jump to

Keyboard shortcuts

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