burrow: github.com/hyperledger/burrow/execution/errors Index | Files

package errors

import "github.com/hyperledger/burrow/execution/errors"


Package Files

code.go codes.go errors.go errors.pb.go exception.go maybe.go native.go vm.go


var (
    ErrInvalidLengthErrors        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowErrors          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupErrors = fmt.Errorf("proto: unexpected end of group")
var Codes = codes{
    None:                   code("none"),
    UnknownAddress:         code("unknown address"),
    InsufficientBalance:    code("insufficient balance"),
    InvalidJumpDest:        code("invalid jump destination"),
    InsufficientGas:        code("insufficient gas"),
    MemoryOutOfBounds:      code("memory out of bounds"),
    CodeOutOfBounds:        code("code out of bounds"),
    InputOutOfBounds:       code("input out of bounds"),
    ReturnDataOutOfBounds:  code("data out of bounds"),
    CallStackOverflow:      code("call stack overflow"),
    CallStackUnderflow:     code("call stack underflow"),
    DataStackOverflow:      code("data stack overflow"),
    DataStackUnderflow:     code("data stack underflow"),
    InvalidContract:        code("invalid contract"),
    PermissionDenied:       code("permission denied"),
    NativeContractCodeCopy: code("tried to copy native contract code"),
    ExecutionAborted:       code("execution aborted"),
    ExecutionReverted:      code("execution reverted"),
    NativeFunction:         code("native function error"),
    EventPublish:           code("event publish error"),
    InvalidString:          code("invalid string"),
    EventMapping:           code("event mapping error"),
    Generic:                code("generic error"),
    InvalidAddress:         code("invalid address"),
    DuplicateAddress:       code("duplicate address"),
    InsufficientFunds:      code("insufficient funds"),
    Overpayment:            code("overpayment"),
    ZeroPayment:            code("zero payment error"),
    InvalidSequence:        code("invalid sequence number"),
    ReservedAddress:        code("address is reserved for SNative or internal use"),
    IllegalWrite:           code("callee attempted to illegally modify state"),
    IntegerOverflow:        code("integer overflow"),
    InvalidProposal:        code("proposal is invalid"),
    ExpiredProposal:        code("proposal is expired since sequence number does not match"),
    ProposalExecuted:       code("proposal has already been executed"),
    NoInputPermission:      code("account has no input permission"),
    InvalidBlockNumber:     code("invalid block number"),
    BlockNumberOutOfRange:  code("block number out of range"),
    AlreadyVoted:           code("vote already registered for this address"),
    UnresolvedSymbols:      code("code has unresolved symbols"),
    InvalidContractCode:    code("contract being created with unexpected code"),
    NonExistentAccount:     code("account does not exist"),

type CallError Uses

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

func (CallError) Error Uses

func (err CallError) Error() string

type Code Uses

type Code struct {
    Number      uint32
    Name        string
    Description string

An annotated version of the pure numeric error code

func GetCode Uses

func GetCode(err error) *Code

func (*Code) Equal Uses

func (c *Code) Equal(other *Code) bool

func (*Code) Error Uses

func (c *Code) Error() string

func (*Code) ErrorCode Uses

func (c *Code) ErrorCode() *Code

func (*Code) ErrorMessage Uses

func (c *Code) ErrorMessage() string

func (*Code) Uint32 Uses

func (c *Code) Uint32() uint32

type CodedError Uses

type CodedError interface {
    ErrorCode() *Code
    // The error message excluding the code
    ErrorMessage() string

type Exception Uses

type Exception struct {
    CodeNumber           uint32   `protobuf:"varint,1,opt,name=Code,proto3" 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 Uses

func AsException(err error) *Exception

Wraps any error as a Exception

func Errorf Uses

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

func NewException Uses

func NewException(code *Code, exception string) *Exception

func Wrap Uses

func Wrap(err error, message string) *Exception

func Wrapf Uses

func Wrapf(err error, format string, a ...interface{}) *Exception

func (*Exception) AsError Uses

func (e *Exception) AsError() error

func (*Exception) Descriptor Uses

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

func (*Exception) Equal Uses

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

func (*Exception) Error Uses

func (e *Exception) Error() string

func (*Exception) ErrorCode Uses

func (e *Exception) ErrorCode() *Code

func (*Exception) ErrorMessage Uses

func (e *Exception) ErrorMessage() string

func (*Exception) GetCode Uses

func (e *Exception) GetCode() *Code

func (*Exception) GetCodeNumber Uses

func (m *Exception) GetCodeNumber() uint32

func (*Exception) GetException Uses

func (m *Exception) GetException() string

func (*Exception) Marshal Uses

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

func (*Exception) MarshalTo Uses

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

func (*Exception) MarshalToSizedBuffer Uses

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

func (*Exception) ProtoMessage Uses

func (*Exception) ProtoMessage()

func (*Exception) Reset Uses

func (m *Exception) Reset()

func (*Exception) Size Uses

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

func (*Exception) String Uses

func (e *Exception) String() string

func (*Exception) Unmarshal Uses

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

func (*Exception) XXX_DiscardUnknown Uses

func (m *Exception) XXX_DiscardUnknown()

func (*Exception) XXX_Marshal Uses

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

func (*Exception) XXX_Merge Uses

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

func (*Exception) XXX_MessageName Uses

func (*Exception) XXX_MessageName() string

func (*Exception) XXX_Size Uses

func (m *Exception) XXX_Size() int

func (*Exception) XXX_Unmarshal Uses

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

type LacksNativePermission Uses

type LacksNativePermission struct {
    Address    crypto.Address
    NativeName string

func (*LacksNativePermission) Error Uses

func (e *LacksNativePermission) Error() string

func (*LacksNativePermission) ErrorCode Uses

func (e *LacksNativePermission) ErrorCode() *Code

func (*LacksNativePermission) ErrorMessage Uses

func (e *LacksNativePermission) ErrorMessage() string

type Maybe Uses

type Maybe struct {
    // contains filtered or unexported fields

func (*Maybe) Address Uses

func (m *Maybe) Address(value crypto.Address, err error) crypto.Address

func (*Maybe) Bool Uses

func (m *Maybe) Bool(value bool, err error) bool

func (*Maybe) Bytes Uses

func (m *Maybe) Bytes(value []byte, err error) []byte

func (*Maybe) Error Uses

func (m *Maybe) Error() error

func (*Maybe) PushError Uses

func (m *Maybe) PushError(err error) bool

Errors pushed to state may end up in TxExecutions and therefore the merkle state so it is essential that errors are deterministic and independent of the code path taken to execution (e.g. replay takes a different path to that of normal consensus reactor so stack traces may differ - as they may across architectures)

func (*Maybe) Uint64 Uses

func (m *Maybe) Uint64(value uint64, err error) uint64

func (*Maybe) Void Uses

func (m *Maybe) Void(err error)

type NestedCallError Uses

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

func (NestedCallError) Error Uses

func (err NestedCallError) Error() string

type PermissionDenied Uses

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

func (PermissionDenied) Error Uses

func (err PermissionDenied) Error() string

func (PermissionDenied) ErrorCode Uses

func (err PermissionDenied) ErrorCode() *Code

type Sink Uses

type Sink interface {
    // Push an error to the error. If a nil error is passed then that value should not be pushed. Returns true iff error
    // is non nil.
    PushError(error) bool

Error sinks are useful for recording errors but continuing with computation. Implementations may choose to just store the first error pushed and ignore subsequent ones or they may record an error trace. Pushing a nil error should have no effects.

type Source Uses

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

Package errors imports 12 packages (graph) and is imported by 45 packages. Updated 2020-03-30. Refresh now. Tools for package owners.