Skip to content

Commit

Permalink
refactor: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyhyde committed Jan 3, 2025
1 parent f5ce284 commit da94175
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions launchpad/errors.gno
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ import (
)

var (
errNoPermission = errors.New("[GNOSWAP-LAUNCHPAD-001] caller has no permission")
errNotRegistered = errors.New("[GNOSWAP-LAUNCHPAD-002] not registered token")
errAlreadyRegistered = errors.New("[GNOSWAP-LAUNCHPAD-003] already registered token")
errLocked = errors.New("[GNOSWAP-LAUNCHPAD-004] can't transfer token while locked")
errInvalidAddress = errors.New("[GNOSWAP-LAUNCHPAD-005] invalid address")
errDataNotFound = errors.New("[GNOSWAP-LAUNCHPAD-006] requested data not found")
errActiveProject = errors.New("[GNOSWAP-LAUNCHPAD-007] project is active")
errInactiveProject = errors.New("[GNOSWAP-LAUNCHPAD-008] project is inactive")
errInactiveTier = errors.New("[GNOSWAP-LAUNCHPAD-009] pool is inactive")
errInvalidInput = errors.New("[GNOSWAP-LAUNCHPAD-010] invalid input data")
errDuplicateProject = errors.New("[GNOSWAP-LAUNCHPAD-011] can not create same project in same block")
errInvalidTier = errors.New("[GNOSWAP-LAUNCHPAD-012] invalid pool")
errInvalidTierRatio = errors.New("[GNOSWAP-LAUNCHPAD-013] invalid pool ratio")
errPastStartTime = errors.New("[GNOSWAP-LAUNCHPAD-014] can not start from past time")
errNotEnoughBalance = errors.New("[GNOSWAP-LAUNCHPAD-015] not enough balance")
errAlreadyRefunded = errors.New("[GNOSWAP-LAUNCHPAD-016] already refunded")
errNoLeftReward = errors.New("[GNOSWAP-LAUNCHPAD-001] no left reward")
errInvalidAddress = errors.New("[GNOSWAP-LAUNCHPAD-002] invalid address")
errDataNotFound = errors.New("[GNOSWAP-LAUNCHPAD-003] requested data not found")
errActiveProject = errors.New("[GNOSWAP-LAUNCHPAD-004] project is active")
errInactiveProject = errors.New("[GNOSWAP-LAUNCHPAD-005] project is inactive")
errInactiveTier = errors.New("[GNOSWAP-LAUNCHPAD-006] pool is inactive")
errInvalidInput = errors.New("[GNOSWAP-LAUNCHPAD-007] invalid input data")
errDuplicateProject = errors.New("[GNOSWAP-LAUNCHPAD-008] can not create same project in same block")
errInvalidTier = errors.New("[GNOSWAP-LAUNCHPAD-009] invalid pool")
errInvalidTierRatio = errors.New("[GNOSWAP-LAUNCHPAD-010] invalid pool ratio")
errPastStartTime = errors.New("[GNOSWAP-LAUNCHPAD-011] can not start from past time")
errNotEnoughBalance = errors.New("[GNOSWAP-LAUNCHPAD-012] not enough balance")
errAlreadyRefunded = errors.New("[GNOSWAP-LAUNCHPAD-013] already refunded")
)

func addDetailToError(err error, detail string) string {
Expand Down

0 comments on commit da94175

Please sign in to comment.