Test monotonicWordToDouble's monotonicity over the full range of Word64s
[rootstock.git] / RootstockException.hs
blob3e1cd962293ba4a0721d1ad7c0f5951ef1f42066
1 module RootstockException where
2 import Control.Monad.Trans.Error (Error, strMsg)
4 data RootstockException
5 = NotRunning
6 | DatabaseExists
7 | InsufficientForReserve
8 | LineNotFound
9 | NonPositiveLine
10 | DatabaseNotSetUp
11 | NonPositivePrice
12 | CurrencyAlreadyPresent
13 | NewOutweighsOld
14 | StrMsg String
16 instance Show RootstockException where
17 show NotRunning
18 = "According to the database, Rootstock shouldn't be running now"
19 show DatabaseExists
20 = "Database already has nodes"
21 show InsufficientForReserve
22 = "Not enough XRP to meet desired reserve"
23 show LineNotFound
24 = "Requested IOU line not found"
25 show NonPositiveLine
26 = "Non-positive balance in requested IOU line"
27 show DatabaseNotSetUp
28 = "The database doesn't seem to have been set up yet"
29 show NonPositivePrice
30 = "The price given should be positive, but isn't"
31 show CurrencyAlreadyPresent
32 = "The specified currency is already being managed by Rootstock"
33 show NewOutweighsOld
34 = "The currency to be added is too much to fit into the current Rootstock"
35 show (StrMsg s) = s
37 instance Error RootstockException where
38 strMsg = StrMsg