Documentation ¶
Index ¶
- Variables
- type CallError
- type Code
- type CodedError
- type Exception
- func (e *Exception) AsError() error
- func (*Exception) Descriptor() ([]byte, []int)
- func (e *Exception) Equal(ce CodedError) bool
- func (e *Exception) Error() string
- func (e *Exception) ErrorCode() *Code
- func (e *Exception) ErrorMessage() string
- func (e *Exception) GetCode() *Code
- func (m *Exception) GetCodeNumber() uint32
- func (m *Exception) GetException() string
- func (m *Exception) Marshal() (dAtA []byte, err error)
- func (m *Exception) MarshalTo(dAtA []byte) (int, error)
- func (m *Exception) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Exception) ProtoMessage()
- func (m *Exception) Reset()
- func (m *Exception) Size() (n int)
- func (e *Exception) String() string
- func (m *Exception) Unmarshal(dAtA []byte) error
- func (m *Exception) XXX_DiscardUnknown()
- func (m *Exception) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Exception) XXX_Merge(src proto.Message)
- func (*Exception) XXX_MessageName() string
- func (m *Exception) XXX_Size() int
- func (m *Exception) XXX_Unmarshal(b []byte) error
- type LacksNativePermission
- type Maybe
- func (m *Maybe) Address(value crypto.Address, err error) crypto.Address
- func (m *Maybe) BigInt(value *big.Int, err error) *big.Int
- func (m *Maybe) Bool(value bool, err error) bool
- func (m *Maybe) Bytes(value []byte, err error) []byte
- func (m *Maybe) Error() error
- func (m *Maybe) PushError(err error) bool
- func (m *Maybe) Uint64(value uint64, err error) uint64
- func (m *Maybe) Void(err error)
- type NestedCallError
- type PermissionDenied
- type Sink
- type Source
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthErrors = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowErrors = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupErrors = fmt.Errorf("proto: unexpected end of group") )
View Source
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"),
NotCallable: code("cannot dispatch call"),
}
Functions ¶
This section is empty.
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 }
type Code ¶
An annotated version of the pure numeric error code
func (*Code) ErrorMessage ¶ added in v0.29.0
type CodedError ¶
type Exception ¶
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 ¶ added in v0.20.0
Wraps any error as a Exception
func NewException ¶ added in v0.20.1
func (*Exception) Descriptor ¶
func (*Exception) Equal ¶ added in v0.23.0
func (e *Exception) Equal(ce CodedError) bool
func (*Exception) ErrorMessage ¶ added in v0.29.0
func (*Exception) GetCodeNumber ¶ added in v0.29.0
func (*Exception) GetException ¶
func (*Exception) MarshalToSizedBuffer ¶ added in v0.30.0
func (*Exception) ProtoMessage ¶
func (*Exception) ProtoMessage()
func (*Exception) XXX_DiscardUnknown ¶
func (m *Exception) XXX_DiscardUnknown()
func (*Exception) XXX_Marshal ¶
func (*Exception) XXX_MessageName ¶ added in v0.20.0
func (*Exception) XXX_Unmarshal ¶
type LacksNativePermission ¶ added in v0.29.0
func (*LacksNativePermission) Error ¶ added in v0.29.0
func (e *LacksNativePermission) Error() string
func (*LacksNativePermission) ErrorCode ¶ added in v0.29.0
func (e *LacksNativePermission) ErrorCode() *Code
func (*LacksNativePermission) ErrorMessage ¶ added in v0.29.0
func (e *LacksNativePermission) ErrorMessage() string
type Maybe ¶ added in v0.29.0
type Maybe struct {
// contains filtered or unexported fields
}
func (*Maybe) PushError ¶ added in v0.29.0
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)
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 Sink ¶ added in v0.23.0
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.
Click to show internal directories.
Click to hide internal directories.