errors.gno
1.08 Kb ยท 24 lines
1package v1
2
3import (
4 "errors"
5
6 "gno.land/p/nt/ufmt"
7)
8
9var (
10 errDataNotFound = errors.New("[GNOSWAP-GOV_STAKER-001] requested data not found")
11 errInvalidAmount = errors.New("[GNOSWAP-GOV_STAKER-002] invalid amount")
12 errNoDelegatedAmount = errors.New("[GNOSWAP-GOV_STAKER-003] zero delegated amount")
13 errNotEnoughDelegated = errors.New("[GNOSWAP-GOV_STAKER-004] not enough delegated")
14 errInvalidAddress = errors.New("[GNOSWAP-GOV_STAKER-005] invalid address")
15 errNotEnoughBalance = errors.New("[GNOSWAP-GOV_STAKER-006] not enough balance")
16 errLessThanMinimum = errors.New("[GNOSWAP-GOV_STAKER-007] cannot delegate less than minimum amount")
17 errInvalidSnapshotTime = errors.New("[GNOSWAP-GOV_STAKER-008] invalid snapshot time")
18 errSameDelegatee = errors.New("[GNOSWAP-GOV_STAKER-009] cannot redelegate to same address")
19 errWithdrawNotCollectable = errors.New("[GNOSWAP-GOV_STAKER-010] withdraw is not collectable")
20)
21
22func makeErrorWithDetails(err error, detail string) error {
23 return ufmt.Errorf("%s || %s", err.Error(), detail)
24}