{"modulePath":"github.com/hyperledger/burrow","version":"v0.34.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar (\n\tErrInvalidLengthErrors        = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowErrors          = fmt.Errorf(\"proto: integer overflow\")\n\tErrUnexpectedEndOfGroupErrors = fmt.Errorf(\"proto: unexpected end of group\")\n)\n```\n\n```go\nvar Codes = \u0026codes{\n\tNone:                   code(\"none\"),\n\tUnknownAddress:         code(\"unknown address\"),\n\tInsufficientBalance:    code(\"insufficient balance\"),\n\tInvalidJumpDest:        code(\"invalid jump destination\"),\n\tInsufficientGas:        code(\"insufficient gas\"),\n\tMemoryOutOfBounds:      code(\"memory out of bounds\"),\n\tCodeOutOfBounds:        code(\"code out of bounds\"),\n\tInputOutOfBounds:       code(\"input out of bounds\"),\n\tReturnDataOutOfBounds:  code(\"data out of bounds\"),\n\tCallStackOverflow:      code(\"call stack overflow\"),\n\tCallStackUnderflow:     code(\"call stack underflow\"),\n\tDataStackOverflow:      code(\"data stack overflow\"),\n\tDataStackUnderflow:     code(\"data stack underflow\"),\n\tInvalidContract:        code(\"invalid contract\"),\n\tPermissionDenied:       code(\"permission denied\"),\n\tNativeContractCodeCopy: code(\"tried to copy native contract code\"),\n\tExecutionAborted:       code(\"execution aborted\"),\n\tExecutionReverted:      code(\"execution reverted\"),\n\tNativeFunction:         code(\"native function error\"),\n\tEventPublish:           code(\"event publish error\"),\n\tInvalidString:          code(\"invalid string\"),\n\tEventMapping:           code(\"event mapping error\"),\n\tGeneric:                code(\"generic error\"),\n\tInvalidAddress:         code(\"invalid address\"),\n\tDuplicateAddress:       code(\"duplicate address\"),\n\tInsufficientFunds:      code(\"insufficient funds\"),\n\tOverpayment:            code(\"overpayment\"),\n\tZeroPayment:            code(\"zero payment error\"),\n\tInvalidSequence:        code(\"invalid sequence number\"),\n\tReservedAddress:        code(\"address is reserved for SNative or internal use\"),\n\tIllegalWrite:           code(\"callee attempted to illegally modify state\"),\n\tIntegerOverflow:        code(\"integer overflow\"),\n\tInvalidProposal:        code(\"proposal is invalid\"),\n\tExpiredProposal:        code(\"proposal is expired since sequence number does not match\"),\n\tProposalExecuted:       code(\"proposal has already been executed\"),\n\tNoInputPermission:      code(\"account has no input permission\"),\n\tInvalidBlockNumber:     code(\"invalid block number\"),\n\tBlockNumberOutOfRange:  code(\"block number out of range\"),\n\tAlreadyVoted:           code(\"vote already registered for this address\"),\n\tUnresolvedSymbols:      code(\"code has unresolved symbols\"),\n\tInvalidContractCode:    code(\"contract being created with unexpected code\"),\n\tNonExistentAccount:     code(\"account does not exist\"),\n\tNotCallable:            code(\"cannot dispatch call\"),\n}\n```\n\n## Types\n\n```go\ntype CallError struct {\n\t// The error from the original call which defines the overall error code\n\tCodedError\n\t// Errors from nested sub-calls of the original call that may have also occurred\n\tNestedErrors []NestedCallError\n}\n```\n\n```go\nfunc (err CallError) Error() string\n```\n\n```go\ntype Code struct {\n\tNumber      uint32\n\tName        string\n\tDescription string\n}\n```\nAn annotated version of the pure numeric error code\n\n```go\nfunc GetCode(err error) *Code\n```\n\n```go\nfunc (c *Code) Equal(other *Code) bool\n```\n\n```go\nfunc (c *Code) Error() string\n```\n\n```go\nfunc (c *Code) ErrorCode() *Code\n```\n\n```go\nfunc (c *Code) ErrorMessage() string\n```\n\n```go\nfunc (c *Code) Uint32() uint32\n```\n\n```go\ntype CodedError interface {\n\terror\n\tErrorCode() *Code\n\t// The error message excluding the code\n\tErrorMessage() string\n}\n```\n\n```go\ntype Exception struct {\n\tCodeNumber           uint32   `protobuf:\"varint,1,opt,name=Code,proto3\" json:\"Code,omitempty\"`\n\tException            string   `protobuf:\"bytes,2,opt,name=Exception,proto3\" json:\"Exception,omitempty\"`\n\tXXX_NoUnkeyedLiteral struct{} `json:\"-\"`\n\tXXX_unrecognized     []byte   `json:\"-\"`\n\tXXX_sizecache        int32    `json:\"-\"`\n}\n```\n\n```go\nfunc AsException(err error) *Exception\n```\nWraps any error as a Exception\n\n```go\nfunc Errorf(code *Code, format string, a ...interface{}) *Exception\n```\n\n```go\nfunc NewException(code *Code, exception string) *Exception\n```\n\n```go\nfunc Wrap(err error, message string) *Exception\n```\n\n```go\nfunc Wrapf(err error, format string, a ...interface{}) *Exception\n```\n\n```go\nfunc (e *Exception) AsError() error\n```\n\n```go\nfunc (*Exception) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (e *Exception) Equal(ce CodedError) bool\n```\n\n```go\nfunc (e *Exception) Error() string\n```\n\n```go\nfunc (e *Exception) ErrorCode() *Code\n```\n\n```go\nfunc (e *Exception) ErrorMessage() string\n```\n\n```go\nfunc (e *Exception) GetCode() *Code\n```\n\n```go\nfunc (m *Exception) GetCodeNumber() uint32\n```\n\n```go\nfunc (m *Exception) GetException() string\n```\n\n```go\nfunc (m *Exception) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *Exception) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *Exception) MarshalToSizedBuffer(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*Exception) ProtoMessage()\n```\n\n```go\nfunc (m *Exception) Reset()\n```\n\n```go\nfunc (m *Exception) Size() (n int)\n```\n\n```go\nfunc (e *Exception) String() string\n```\n\n```go\nfunc (m *Exception) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (m *Exception) XXX_DiscardUnknown()\n```\n\n```go\nfunc (m *Exception) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)\n```\n\n```go\nfunc (m *Exception) XXX_Merge(src proto.Message)\n```\n\n```go\nfunc (*Exception) XXX_MessageName() string\n```\n\n```go\nfunc (m *Exception) XXX_Size() int\n```\n\n```go\nfunc (m *Exception) XXX_Unmarshal(b []byte) error\n```\n\n```go\ntype LacksNativePermission struct {\n\tAddress    crypto.Address\n\tNativeName string\n}\n```\n\n```go\nfunc (e *LacksNativePermission) Error() string\n```\n\n```go\nfunc (e *LacksNativePermission) ErrorCode() *Code\n```\n\n```go\nfunc (e *LacksNativePermission) ErrorMessage() string\n```\n\n```go\ntype Maybe struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *Maybe) Address(value crypto.Address, err error) crypto.Address\n```\n\n```go\nfunc (m *Maybe) BigInt(value *big.Int, err error) *big.Int\n```\n\n```go\nfunc (m *Maybe) Bool(value bool, err error) bool\n```\n\n```go\nfunc (m *Maybe) Bytes(value []byte, err error) []byte\n```\n\n```go\nfunc (m *Maybe) Error() error\n```\n\n```go\nfunc (m *Maybe) PushError(err error) bool\n```\nErrors 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)\n\n```go\nfunc (m *Maybe) Uint64(value uint64, err error) uint64\n```\n\n```go\nfunc (m *Maybe) Void(err error)\n```\n\n```go\ntype NestedCallError struct {\n\tCodedError\n\tCaller     crypto.Address\n\tCallee     crypto.Address\n\tStackDepth uint64\n}\n```\n\n```go\nfunc (err NestedCallError) Error() string\n```\n\n```go\ntype PermissionDenied struct {\n\tAddress crypto.Address\n\tPerm    permission.PermFlag\n}\n```\n\n```go\nfunc (err PermissionDenied) Error() string\n```\n\n```go\nfunc (err PermissionDenied) ErrorCode() *Code\n```\n\n```go\ntype Sink interface {\n\t// Push an error to the error. If a nil error is passed then that value should not be pushed. Returns true iff error\n\t// is non nil.\n\tPushError(error) bool\n}\n```\nError 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.\n\n```go\ntype Source interface {\n\t// Returns the an error if errors occurred some execution or nil if none occurred\n\tError() error\n}\n```\n\n","path":"github.com/hyperledger/burrow/execution/errors","name":"errors","synopsis":"","isRedistributable":true}
