errors

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthErrors = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowErrors   = fmt.Errorf("proto: integer overflow")
)

Functions

func FirstOnly added in v0.23.0

func FirstOnly() *singleError

Types

type CallError added in v0.23.0

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 added in v0.23.0

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
)

func (Code) Error

func (c Code) Error() string

func (Code) ErrorCode

func (c Code) ErrorCode() Code

func (Code) String added in v0.20.0

func (c Code) String() string

func (Code) Uint32 added in v0.20.0

func (c Code) Uint32() uint32

type CodedError

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

type Exception

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

func AsException added in v0.20.0

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 added in v0.20.1

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) Descriptor

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

func (*Exception) Equal added in v0.23.0

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) GetCode

func (m *Exception) GetCode() Code

func (*Exception) GetException

func (m *Exception) GetException() string

func (*Exception) Marshal added in v0.20.0

func (m *Exception) Marshal() (dAtA []byte, err error)

func (*Exception) MarshalTo added in v0.20.0

func (m *Exception) MarshalTo(dAtA []byte) (int, error)

func (*Exception) ProtoMessage

func (*Exception) ProtoMessage()

func (*Exception) Reset

func (m *Exception) Reset()

func (*Exception) Size added in v0.20.0

func (m *Exception) Size() (n int)

func (*Exception) String

func (e *Exception) String() string

func (*Exception) Unmarshal added in v0.20.0

func (m *Exception) Unmarshal(dAtA []byte) error

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 (m *Exception) XXX_Merge(src proto.Message)

func (*Exception) XXX_MessageName added in v0.20.0

func (*Exception) XXX_MessageName() string

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 NestedCallError added in v0.23.0

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

func (NestedCallError) Error added in v0.23.0

func (err NestedCallError) Error() string

type PermissionDenied

type PermissionDenied struct {
	Address crypto.Address
	Perm    permission.PermFlag
}

func (PermissionDenied) Error

func (err PermissionDenied) Error() string

func (PermissionDenied) ErrorCode

func (err PermissionDenied) ErrorCode() Code

type Provider added in v0.23.0

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

type Sink added in v0.23.0

type Sink interface {
	PushError(error)
}

Jump to

Keyboard shortcuts

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