refactor(store/v2): remove SDK error registration (#19708)
This commit is contained in:
parent
f69dabe241
commit
fbff6ffe42
@ -1,47 +1,43 @@
|
||||
package errors
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
)
|
||||
|
||||
// StoreCodespace defines the store package's unique error code space.
|
||||
const StoreCodespace = "storev2"
|
||||
|
||||
var (
|
||||
// ErrInvalidProof is returned when a proof is invalid
|
||||
ErrInvalidProof = errors.Register(StoreCodespace, 2, "invalid proof")
|
||||
ErrInvalidProof = errors.New("invalid proof")
|
||||
|
||||
// ErrTxDecode is returned if we cannot parse a transaction
|
||||
ErrTxDecode = errors.Register(StoreCodespace, 3, "tx parse error")
|
||||
ErrTxDecode = errors.New("tx parse error")
|
||||
|
||||
// ErrUnknownRequest to doc
|
||||
ErrUnknownRequest = errors.Register(StoreCodespace, 4, "unknown request")
|
||||
ErrUnknownRequest = errors.New("unknown request")
|
||||
|
||||
// ErrLogic defines an internal logic error, e.g. an invariant or assertion
|
||||
// that is violated. It is a programmer error, not a user-facing error.
|
||||
ErrLogic = errors.Register(StoreCodespace, 5, "internal logic error")
|
||||
ErrLogic = errors.New("internal logic error")
|
||||
|
||||
// ErrConflict defines a conflict error, e.g. when two goroutines try to access
|
||||
// the same resource and one of them fails.
|
||||
ErrConflict = errors.Register(StoreCodespace, 6, "conflict")
|
||||
ErrConflict = errors.New("conflict")
|
||||
|
||||
// ErrInvalidRequest defines an ABCI typed error where the request contains
|
||||
// invalid data.
|
||||
ErrInvalidRequest = errors.Register(StoreCodespace, 7, "invalid request")
|
||||
ErrInvalidRequest = errors.New("invalid request")
|
||||
|
||||
ErrClosed = errors.Register(StoreCodespace, 8, "closed")
|
||||
ErrRecordNotFound = errors.Register(StoreCodespace, 9, "record not found")
|
||||
ErrUnknownStoreKey = errors.Register(StoreCodespace, 10, "unknown store key")
|
||||
ErrKeyEmpty = errors.Register(StoreCodespace, 11, "key empty")
|
||||
ErrStartAfterEnd = errors.Register(StoreCodespace, 12, "start key after end key")
|
||||
ErrClosed = errors.New("closed")
|
||||
ErrRecordNotFound = errors.New("record not found")
|
||||
ErrUnknownStoreKey = errors.New("unknown store key")
|
||||
ErrKeyEmpty = errors.New("key empty")
|
||||
ErrStartAfterEnd = errors.New("start key after end key")
|
||||
|
||||
// ErrBatchClosed is returned when a closed or written batch is used.
|
||||
ErrBatchClosed = errors.Register(StoreCodespace, 13, "batch has been written or closed")
|
||||
ErrBatchClosed = errors.New("batch has been written or closed")
|
||||
|
||||
// ErrValueNil is returned when attempting to set a nil value.
|
||||
ErrValueNil = errors.Register(StoreCodespace, 14, "value nil")
|
||||
ErrValueNil = errors.New("value nil")
|
||||
)
|
||||
|
||||
// ErrVersionPruned defines an error returned when a version queried is pruned
|
||||
|
||||
Loading…
Reference in New Issue
Block a user