errors.gno
1.81 Kb · 31 lines
1package governance
2
3import (
4 ufmt "gno.land/p/nt/ufmt/v0"
5)
6
7const (
8 errInvalidInput = "[GNOSWAP-GOVERNANCE-001] invalid input"
9 errDataNotFound = "[GNOSWAP-GOVERNANCE-002] requested data not found"
10 errNotEnoughBalance = "[GNOSWAP-GOVERNANCE-003] not enough balance"
11 errAlreadyVoted = "[GNOSWAP-GOVERNANCE-004] cannot vote twice"
12 errNotEnoughVotingWeight = "[GNOSWAP-GOVERNANCE-005] not enough voting power"
13 errAlreadyCanceledProposal = "[GNOSWAP-GOVERNANCE-006] cannot cancel already canceled proposal"
14 errUnableToCancelVotingProposal = "[GNOSWAP-GOVERNANCE-007] unable to cancel voting proposal"
15 errTextProposalNotExecutable = "[GNOSWAP-GOVERNANCE-008] cannot execute text proposal"
16 errUnableToVoteOutOfPeriod = "[GNOSWAP-GOVERNANCE-009] unable to vote out of voting period"
17 errInvalidMessageFormat = "[GNOSWAP-GOVERNANCE-010] invalid message format"
18 errAlreadyActiveProposal = "[GNOSWAP-GOVERNANCE-011] already active proposal"
19 errProposalNotFound = "[GNOSWAP-GOVERNANCE-012] proposal not found"
20 errProposalNotExecutable = "[GNOSWAP-GOVERNANCE-013] proposal not executable"
21 errNotProposer = "[GNOSWAP-GOVERNANCE-014] not proposer"
22 errInvalidConfiguration = "[GNOSWAP-GOVERNANCE-015] invalid configuration"
23 errInvalidExecution = "[GNOSWAP-GOVERNANCE-016] invalid execution: handler not found"
24 errInvalidSmoothingPeriod = "[GNOSWAP-GOVERNANCE-017] invalid smoothing period"
25 errSpoofedRealm = "[GNOSWAP-GOVERNANCE-018] spoofed realm: captured cur no longer matches live frame"
26)
27
28// makeErrorWithDetails creates an error with additional context.
29func makeErrorWithDetails(message string, detail string) error {
30 return ufmt.Errorf("%s || %s", message, detail)
31}