errors.gno
3.04 Kb · 49 lines
1package bolo
2
3// Error is the type of every failure Bolo reports (API C10, §7). Each one is a
4// constant, never a variable another realm could reassign (C6), and its text
5// starts with its copy key, which a client turns into a message (UI spec §8).
6type Error string
7
8func (e Error) Error() string { return string(e) }
9
10const (
11 ErrNotFound Error = "err.not_found: no such campaign or receipt"
12 ErrNotUserCall Error = "err.use_wallet: not a direct transaction from a wallet"
13 ErrSessionKey Error = "err.master_key: a session key can't do this"
14 ErrWrongDenom Error = "err.amount: only ugnot is accepted"
15 ErrBadAmount Error = "err.amount: the amount is wrong"
16 ErrDepositMismatch Error = "err.amount: send exactly the creation deposit"
17 ErrPaused Error = "err.paused: Bolo is paused"
18 ErrNotOrganizer Error = "err.not_allowed: only the organizer can do this"
19 ErrNotBeneficiary Error = "err.not_allowed: only the beneficiary can do this"
20 ErrNotAdmin Error = "err.not_allowed: only the admin can do this"
21 ErrCampaignClosed Error = "err.state: the campaign is closed"
22 ErrCampaignSettled Error = "err.state: the campaign is settled"
23 ErrBondSlashed Error = "err.state: the bond was slashed"
24 ErrNoBond Error = "err.state: there is no bond to slash"
25 ErrHoldEnded Error = "err.state: the bond's hold has ended"
26 ErrWrongMode Error = "err.mode: not for this custody mode"
27 ErrNothingToRefund Error = "err.refund: nothing to refund"
28 ErrRefundWindowClosed Error = "err.refund: no refund window is open"
29 ErrExitOpen Error = "err.exit_open: the exit window is open"
30 ErrNotClosable Error = "err.not_yet: the campaign can't be closed yet"
31 ErrNotFinalizable Error = "err.not_yet: the campaign can't be finalized yet"
32 ErrNothingToWithdraw Error = "err.withdraw: nothing to withdraw"
33 ErrTitle Error = "err.text: the title's length is out of bounds"
34 ErrDescription Error = "err.text: the story's length is out of bounds"
35 ErrMessage Error = "err.text: the message's length is out of bounds"
36 ErrUpdate Error = "err.text: the update's length is out of bounds"
37 ErrNotice Error = "err.text: the notice's length is out of bounds"
38 ErrImage Error = "err.text: the photo or its description is invalid"
39 ErrMarkup Error = "err.markup: a story or update holds no image and no raw HTML"
40 ErrBeneficiary Error = "err.input: invalid beneficiary"
41 ErrCategory Error = "err.input: unknown category"
42 ErrMode Error = "err.input: invalid custody mode"
43 ErrDeadline Error = "err.input: invalid deadline"
44 ErrGoal Error = "err.input: invalid goal"
45 ErrSetting Error = "err.input: invalid setting"
46 ErrSunset Error = "err.sunset: this version takes no new campaigns"
47 ErrCapReached Error = "err.cap: the campaign's escrow cap is reached"
48 ErrBooksMismatch Error = "err.internal: the books exceed the bank (INV-1)"
49)