Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

errors.gno

2.41 Kb · 39 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	errCannotCancelIncentive          = "[GNOSWAP-STAKER-023] cannot cancel incentive"
31	errUncollectedPosition            = "[GNOSWAP-STAKER-024] position has uncollected rewards"
32	errDeniedRewardToken              = "[GNOSWAP-STAKER-025] denied reward token"
33	errCannotDenyDefaultToken         = "[GNOSWAP-STAKER-026] cannot deny default token"
34	errInsufficientRewardTokenBalance = "[GNOSWAP-STAKER-027] insufficient reward token balance"
35)
36
37func makeErrorWithDetails(message string, details string) error {
38	return ufmt.Errorf("%s || %s", message, details)
39}