errors.gno
1.55 Kb · 31 lines
1package gnsmath
2
3import (
4 "errors"
5
6 ufmt "gno.land/p/nt/ufmt/v0"
7)
8
9var (
10 errInvalidPoolSqrtPrice = errors.New("invalid pool sqrt price calculation: product/amount != sqrtPX96 or numerator1 <= product")
11 errSqrtPriceOverflow = errors.New("sqrt price overflow")
12 errSqrtPriceExceedsQuotient = errors.New("sqrt price exceeds calculated quotient")
13 errSqrtPriceZero = errors.New("sqrtPX96 should not be zero")
14 errLiquidityZero = errors.New("liquidity should not be zero")
15 errSqrtRatioAX96Zero = errors.New("sqrtRatioAX96 must be greater than zero")
16 errAmount0DeltaOverflow = errors.New("GetAmount0Delta: overflow")
17 errAmount1DeltaOverflow = errors.New("GetAmount1Delta: overflow")
18 errMSBZeroInput = errors.New("input for MSB calculation should not be zero")
19 errLSBZeroInput = errors.New("input for LSB calculation should not be zero")
20 errGetAmount0DeltaNilInput = errors.New("GetAmount0Delta: input parameters cannot be nil")
21 errGetAmount1DeltaNilInput = errors.New("GetAmount1Delta: input parameters cannot be nil")
22 errTickMathOutOfRange = errors.New("tick_math: value out of range")
23 errTickMathInvalidInput = errors.New("tick_math: invalid input data")
24 errTickMathOverflow = errors.New("tick_math: overflow")
25 errLiquidityIdenticalTicks = errors.New("liquidity_math: identical ticks")
26 errLiquidityOverflow = errors.New("liquidity_math: overflow")
27)
28
29func newErrorWithDetail(err error, detail string) string {
30 return ufmt.Errorf("%s || %s", err.Error(), detail).Error()
31}