Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- func CheckResult(err error) abci.ResponseCheckTx
- func DeliverResult(err error) abci.ResponseDeliverTx
- func HasErrorCode(err error, code uint32) bool
- func IsDecodingErr(err error) bool
- func IsInternalErr(err error) bool
- func IsInvalidFormatErr(err error) bool
- func IsMissingSignatureErr(err error) bool
- func IsSameError(pattern error, err error) bool
- func IsTooLargeErr(err error) bool
- func IsUnauthorizedErr(err error) bool
- func IsUnknownKeyErr(err error) bool
- func IsUnknownModuleErr(err error) bool
- func IsUnknownTxTypeErr(err error) bool
- func NoErr(err error) bool
- type CheckErr
- type TMError
- func ErrDecoding() TMError
- func ErrInternal(msg string) TMError
- func ErrInvalidFormat(expected string, tx interface{}) TMError
- func ErrMissingSignature() TMError
- func ErrTooLarge() TMError
- func ErrUnauthorized() TMError
- func ErrUnknownKey(mod string) TMError
- func ErrUnknownModule(mod string) TMError
- func ErrUnknownTxType(tx interface{}) TMError
- func New(msg string, code uint32) TMError
- func WithCode(err error, code uint32) TMError
- func WithMessage(prefix string, err error, code uint32) TMError
- func Wrap(err error) TMError
Constants ¶
const ( CodeTypeInternalErr uint32 = 1 CodeTypeEncodingErr uint32 = 2 CodeTypeUnknownRequest uint32 = 4 CodeTypeUnknownAddress uint32 = 5 CodeTypeBaseUnknownAddress uint32 = 5 // lol fuck it CodeTypeBadNonce uint32 = 6 CodeTypeBaseInvalidInput uint32 = 20 CodeTypeBaseInvalidOutput uint32 = 21 )
Variables ¶
This section is empty.
Functions ¶
func CheckResult ¶ added in v0.8.0
func CheckResult(err error) abci.ResponseCheckTx
CheckResult converts any error into a abci.ResponseCheckTx, preserving as much info as possible if it was already a TMError
func DeliverResult ¶ added in v0.8.0
func DeliverResult(err error) abci.ResponseDeliverTx
DeliverResult converts any error into a abci.ResponseDeliverTx, preserving as much info as possible if it was already a TMError
func HasErrorCode ¶
HasErrorCode checks if this error would return the named error code
func IsInternalErr ¶
IsInternalErr matches any error that is not classified
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 IsUnauthorizedErr ¶
IsUnauthorizedErr is generic helper for any unauthorized errors, also specific sub-types
Types ¶
type TMError ¶
type TMError interface { ErrorCode() uint32 Message() string // contains filtered or unexported methods }
TMError is the tendermint abci return type with stack trace
func New ¶
New adds a stacktrace if necessary and sets the code and msg, overriding the state if err was already TMError
func WithCode ¶
WithCode adds a stacktrace if necessary and sets the code and msg, overriding the state if err was already TMError
func WithMessage ¶
WithMessage prepends some text to the error, then calls WithCode It wraps the original error, so IsSameError will still match on err