Search Apps Documentation Source Content File Folder Download Copy Actions Download

errors.gno

2.33 Kb · 37 lines
 1package v1
 2
 3import (
 4	"errors"
 5
 6	ufmt "gno.land/p/nt/ufmt/v0"
 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	errNotAvailableUpdateCollectTime = errors.New("[GNOSWAP-STAKER-003] not available to update collect time")
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	errInvalidAddress                = errors.New("[GNOSWAP-STAKER-021] invalid address")
31	errIsNotEndedIncentive           = errors.New("[GNOSWAP-STAKER-022] incentive is not ended yet")
32	errSpoofedRealm                  = errors.New("[GNOSWAP-STAKER-023] rlm does not match the current crossing frame")
33)
34
35func makeErrorWithDetails(err error, details string) error {
36	return ufmt.Errorf("%s || %s", err.Error(), details)
37}