-
Notifications
You must be signed in to change notification settings - Fork 666
/
errors.go
34 lines (25 loc) · 1.28 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package errors
import (
errorsmod "cosmossdk.io/errors"
)
const codespace = "gaia"
var (
// ErrTxDecode is returned if we cannot parse a transaction
ErrTxDecode = errorsmod.Register(codespace, 1, "tx parse error")
// ErrUnauthorized is used whenever a request without sufficient
// authorization is handled.
ErrUnauthorized = errorsmod.Register(codespace, 2, "unauthorized")
// ErrInsufficientFunds is used when the account cannot pay requested amount.
ErrInsufficientFunds = errorsmod.Register(codespace, 3, "insufficient funds")
// ErrInsufficientFunds is used when the account cannot pay requested amount.
ErrInsufficientFee = errorsmod.Register(codespace, 4, "insufficient fee")
// ErrInvalidCoins is used when sdk.Coins are invalid.
ErrInvalidCoins = errorsmod.Register(codespace, 5, "invalid coins")
// ErrInvalidType defines an error an invalid type.
ErrInvalidType = errorsmod.Register(codespace, 6, "invalid type")
// 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 = errorsmod.Register(codespace, 7, "internal logic error")
// ErrNotFound defines an error when requested entity doesn't exist in the state.
ErrNotFound = errorsmod.Register(codespace, 8, "not found")
)