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