Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

errors.gno

2.09 Kb · 41 lines
 1package cometbls
 2
 3import (
 4	"errors"
 5	"strings"
 6)
 7
 8// IBC tendermint client sentinel errors
 9var (
10	ErrInvalidChainID                    = errors.New("invalid chain-id")
11	ErrInvalidHeight                     = errors.New("invalid height")
12	ErrInvalidProof                      = errors.New("invalid proof")
13	ErrInvalidConsensus                  = errors.New("invalid consensus state")
14	ErrInvalidNextValidatorsHash         = errors.New("invalid next validators hash")
15	ErrInvalidTrustingPeriod             = errors.New("invalid trusting period")
16	ErrInvalidUnbondingPeriod            = errors.New("invalid unbonding period")
17	ErrInvalidHeaderHeight               = errors.New("invalid header height")
18	ErrInvalidMisbehaviour               = errors.New("invalid misbehaviour")
19	ErrInvalidHeader                     = errors.New("invalid header")
20	ErrInvalidMaxClockDrift              = errors.New("invalid max clock drift")
21	ErrProcessedTimeNotFound             = errors.New("processed time not found")
22	ErrProcessedHeightNotFound           = errors.New("processed height not found")
23	ErrDelayPeriodNotPassed              = errors.New("packet-specified delay period has not been reached")
24	ErrTrustingPeriodExpired             = errors.New("time since latest trusted state has passed the trusting period")
25	ErrUnbondingPeriodExpired            = errors.New("time since latest trusted state has passed the unbonding period")
26	ErrInvalidProofSpecs                 = errors.New("invalid proof specs")
27	ErrInvalidValidatorSet               = errors.New("invalid validator set")
28	ErrInvalidHeaderTimestamp            = errors.New("invalid header timestamp")
29	ErrInvalidMisbehaviourHeaderSequence = errors.New("invalid misbehaviour header sequence")
30	ErrMathOverflow                      = errors.New("math operation with overflow")
31	ErrMisbehaviourNotFound              = errors.New("misbehaviour not found")
32	ErrDecodeState                       = errors.New("decode state error")
33)
34
35func errorWithDetails(err error, msgs ...string) error {
36	if len(msgs) == 0 {
37		return err
38	}
39
40	return errors.New(err.Error() + ", " + strings.Join(msgs, ", "))
41}