Documentation ¶
Index ¶
- Constants
- func ErrDecoding() error
- func ErrInternal(msg string) error
- func ErrInvalidChainID(chainID string) error
- func ErrInvalidSignature() error
- func ErrMissingSignature() error
- func ErrModifyChainID() error
- func ErrTooLarge() error
- func ErrUnauthorized() error
- func ErrUnknownTxType(tx interface{}) error
- func ErrUnrecognizedAddress(addr []byte) error
- func ErrUnrecognizedCondition(cond []byte) error
- func HasErrorCode(err error, code uint32) bool
- func IsDecodingErr(err error) bool
- func IsInternalErr(err error) bool
- func IsInvalidChainIDErr(err error) bool
- func IsInvalidSignatureErr(err error) bool
- func IsMissingSignatureErr(err error) bool
- func IsModifyChainIDErr(err error) bool
- func IsSameError(pattern error, err error) bool
- func IsTooLargeErr(err error) bool
- func IsUnauthorizedErr(err error) bool
- func IsUnknownTxTypeErr(err error) bool
- func IsUnrecognizedAddressErr(err error) bool
- func IsUnrecognizedConditionErr(err error) bool
- func New(log string, code uint32) error
- func NormalizePanic(p interface{}) error
- func Recover(err *error)
- type TMError
Constants ¶
const ( CodeInternalErr uint32 = 1 CodeTxParseError = 2 CodeUnknownRequest = 4 CodeUnrecognizedAddress = 5 CodeInvalidChainID = 6 )
ABCI Response Codes Base SDK reserves 0 ~ 99.
Variables ¶
This section is empty.
Functions ¶
func ErrDecoding ¶
func ErrDecoding() error
ErrDecoding is generic when we cannot parse the transaction input
func ErrInternal ¶
ErrInternal is a generic error code when we cannot return any more useful info
func ErrInvalidChainID ¶
ErrInvalidChainID is when the chainID is the wrong format
func ErrInvalidSignature ¶
func ErrInvalidSignature() error
ErrInvalidSignature is when the signature doesn't match (bad key, bad nonce, bad chainID)
func ErrMissingSignature ¶
func ErrMissingSignature() error
ErrMissingSignature is returned when no signature is present
func ErrModifyChainID ¶
func ErrModifyChainID() error
ErrModifyChainID is when someone tries to change the chainID after genesis
func ErrTooLarge ¶
func ErrTooLarge() error
ErrTooLarge is a specific decode error when we pass the max tx size
func ErrUnauthorized ¶
func ErrUnauthorized() error
ErrUnauthorized is a generic denial. You can use a more specific cause if you wish, such as ErrInvalidSignature
func ErrUnknownTxType ¶
func ErrUnknownTxType(tx interface{}) error
ErrUnknownTxType creates an error for unexpected transaction objects
func ErrUnrecognizedAddress ¶
ErrUnrecognizedAddress may be used for empty addresses, or badly formatted addresses
func ErrUnrecognizedCondition ¶ added in v0.4.0
ErrUnrecognizedCondition is used for anything that is not the proper format
func HasErrorCode ¶
HasErrorCode checks if this error would return the named error code
func IsDecodingErr ¶
IsDecodingErr returns true for any error with a ParseError code
func IsInternalErr ¶
IsInternalErr returns true for any error that is not classified
func IsInvalidChainIDErr ¶
IsInvalidChainIDErr returns true iff an error was created with ErrInvalidChainID
func IsInvalidSignatureErr ¶
IsInvalidSignatureErr returns true iff an error was created with ErrInvalidSignature
func IsMissingSignatureErr ¶
IsMissingSignatureErr returns true iff an error was created with ErrMissingSignature
func IsModifyChainIDErr ¶
IsModifyChainIDErr returns true iff an error was created with ErrModifyChainID
func IsSameError ¶
IsSameError returns true if these errors have the same root cause. pattern is the expected error type and should always be non-nil err may be anything and returns true if it is a wrapped version of pattern
func IsTooLargeErr ¶
IsTooLargeErr returns true iff an error was created with ErrTooLarge
func IsUnauthorizedErr ¶
IsUnauthorizedErr is generic helper for any unauthorized errors, also specific sub-types
func IsUnknownTxTypeErr ¶
IsUnknownTxTypeErr returns true if an error was created with ErrUnknownTxType
func IsUnrecognizedAddressErr ¶
IsUnrecognizedAddressErr returns true iff an error was created with ErrUnrecognizedAddress
func IsUnrecognizedConditionErr ¶ added in v0.4.0
IsUnrecognizedConditionErr returns true iff an error was created with ErrUnrecognizedCondition
func New ¶
New creates an error with the given message and a stacktrace, and sets the code and log, overriding the state if err was already TMError
func NormalizePanic ¶
func NormalizePanic(p interface{}) error
NormalizePanic converts a panic into a proper error
Types ¶
type TMError ¶
type TMError interface { ABCICode() uint32 ABCILog() string // contains filtered or unexported methods }
TMError is the tendermint abci return type with stack trace
func WithCode ¶
WithCode adds a stacktrace if necessary and sets the code and msg, overriding the code if err was already TMError