Search Apps Documentation Source Content File Folder Download Copy Actions Download

errors.gno

2.14 Kb ยท 35 lines
 1package v1
 2
 3import (
 4	"errors"
 5
 6	"gno.land/p/nt/ufmt"
 7)
 8
 9var (
10	errNoPermission                  = errors.New("[GNOSWAP-STAKER-001] caller has no permission")
11	errPoolNotFound                  = errors.New("[GNOSWAP-STAKER-002] pool not found")
12	errWugnotMinimum                 = errors.New("[GNOSWAP-STAKER-003] cannot wrap less than minimum amount")
13	errInvalidInput                  = errors.New("[GNOSWAP-STAKER-004] invalid input data")
14	errInvalidUnstakingFee           = errors.New("[GNOSWAP-STAKER-005] invalid unstaking fee")
15	errAlreadyStaked                 = errors.New("[GNOSWAP-STAKER-006] already staked position")
16	errNonIncentivizedPool           = errors.New("[GNOSWAP-STAKER-007] pool is not incentivized")
17	errCannotEndIncentive            = errors.New("[GNOSWAP-STAKER-008] cannot end incentive")
18	errInvalidIncentiveStartTime     = errors.New("[GNOSWAP-STAKER-009] invalid incentive start time")
19	errDefaultExternalToken          = errors.New("[GNOSWAP-STAKER-010] cannot delete default external token")
20	errInvalidPoolPath               = errors.New("[GNOSWAP-STAKER-011] invalid pool path")
21	errInvalidPoolTier               = errors.New("[GNOSWAP-STAKER-012] invalid pool tier")
22	errDataNotFound                  = errors.New("[GNOSWAP-STAKER-013] requested data not found")
23	errCalculationError              = errors.New("[GNOSWAP-STAKER-014] unexpected calculation error")
24	errZeroLiquidity                 = errors.New("[GNOSWAP-STAKER-015] zero liquidity")
25	errInvalidIncentiveDuration      = errors.New("[GNOSWAP-STAKER-016] invalid incentive duration")
26	errNotAllowedForExternalReward   = errors.New("[GNOSWAP-STAKER-017] not allowed for external reward")
27	errIncentiveAlreadyExists        = errors.New("[GNOSWAP-STAKER-018] incentive already exists")
28	errOverflow                      = errors.New("[GNOSWAP-STAKER-019] overflow")
29	errAddExistingToken              = errors.New("[GNOSWAP-STAKER-020] cannot add existing token")
30	errNotAvailableUpdateCollectTime = errors.New("[GNOSWAP-STAKER-021] not available to update collect time")
31)
32
33func makeErrorWithDetails(err error, details string) error {
34	return ufmt.Errorf("%s || %s", err.Error(), details)
35}