diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/src/Thermoprint/API.hs | 13 | 
1 files changed, 11 insertions, 2 deletions
| diff --git a/spec/src/Thermoprint/API.hs b/spec/src/Thermoprint/API.hs index 6c020fc..6f7fc02 100644 --- a/spec/src/Thermoprint/API.hs +++ b/spec/src/Thermoprint/API.hs | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} | 1 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} | 
| 2 | {-# LANGUAGE TypeOperators, DataKinds #-} | 2 | {-# LANGUAGE TypeOperators, DataKinds #-} | 
| 3 | {-# LANGUAGE StandaloneDeriving #-} | ||
| 3 | {-# LANGUAGE OverloadedStrings #-} | 4 | {-# LANGUAGE OverloadedStrings #-} | 
| 4 | 5 | ||
| 5 | -- | A specification of an API for interacting with a set of printers | 6 | -- | A specification of an API for interacting with a set of printers | 
| @@ -59,8 +60,16 @@ data JobStatus = Queued PrinterId | |||
| 59 | | Failed PrintingError | 60 | | Failed PrintingError | 
| 60 | deriving (Generic, Show, FromJSON, ToJSON) | 61 | deriving (Generic, Show, FromJSON, ToJSON) | 
| 61 | 62 | ||
| 62 | data PrintingError = UnknownError | 63 | deriving instance Generic EncodingException | 
| 63 | deriving (Typeable, Generic, NFData, Show, FromJSON, ToJSON, Exception) | 64 | deriving instance NFData EncodingException | 
| 65 | deriving instance FromJSON EncodingException | ||
| 66 | deriving instance ToJSON EncodingException | ||
| 67 | |||
| 68 | data PrintingError = IOError String -- ^ Not the actual error because we can't marshal that to JSON | ||
| 69 | | EncError EncodingException -- ^ Could not encode some part of the 'Printout' | ||
| 70 | deriving (Typeable, Generic, NFData, Show, FromJSON, ToJSON) | ||
| 71 | |||
| 72 | instance Exception PrintingError | ||
| 64 | 73 | ||
| 65 | type DraftTitle = Text | 74 | type DraftTitle = Text | 
| 66 | 75 | ||
