errors.gno
1.62 Kb · 34 lines
1package position
2
3import (
4 ufmt "gno.land/p/nt/ufmt/v0"
5)
6
7const (
8 errNoPermission = "[GNOSWAP-POSITION-001] caller has no permission"
9 errSlippage = "[GNOSWAP-POSITION-002] slippage failed"
10 errInvalidTokenPath = "[GNOSWAP-POSITION-003] invalid token address"
11 errInvalidInput = "[GNOSWAP-POSITION-004] invalid input data"
12 errDataNotFound = "[GNOSWAP-POSITION-005] requested data not found"
13 errExpired = "[GNOSWAP-POSITION-006] transaction expired"
14 errInvalidLiquidity = "[GNOSWAP-POSITION-007] invalid liquidity"
15 errNotClear = "[GNOSWAP-POSITION-008] position is not clear"
16 errZeroLiquidity = "[GNOSWAP-POSITION-009] zero liquidity"
17 errPositionExist = "[GNOSWAP-POSITION-010] position with same positionId already exists"
18 errInvalidAddress = "[GNOSWAP-POSITION-011] invalid address"
19 errPositionDoesNotExist = "[GNOSWAP-POSITION-012] position does not exist"
20 errUnderflow = "[GNOSWAP-POSITION-013] underflow"
21 errOverflow = "[GNOSWAP-POSITION-014] overflow"
22 errCannotMintToStaker = "[GNOSWAP-POSITION-015] cannot mint to staker"
23 errSpoofedRealm = "[GNOSWAP-POSITION-016] rlm does not match the current crossing frame"
24)
25
26// newErrorWithDetail appends additional context or details to an existing error message.
27func newErrorWithDetail(message string, detail string) string {
28 return ufmt.Errorf("%s || %s", message, detail).Error()
29}
30
31// makeErrorWithDetails creates an error with additional context.
32func makeErrorWithDetails(message string, details string) error {
33 return ufmt.Errorf("%s || %s", message, details)
34}