errors

package
v0.0.0-...-25a45d7 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 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

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
)

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
}

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

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

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

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

func (m *Exception) GetCode() Code

func (*Exception) GetException

func (m *Exception) GetException() string

func (*Exception) Marshal

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

func (*Exception) MarshalTo

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

func (*Exception) ProtoMessage

func (*Exception) ProtoMessage()

func (*Exception) Reset

func (m *Exception) Reset()

func (*Exception) Size

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

func (*Exception) String

func (e *Exception) String() string

func (*Exception) Unmarshal

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

func (*Exception) XXX_MessageName

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

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

func (NestedCallError) Error

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

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