This commit is contained in:
Nikita Volkov 2015-11-21 17:52:25 +03:00
parent ed23377f2e
commit 05dc480ab9

View File

@ -37,15 +37,21 @@ import qualified Hasql.IO as IO
data Connection =
Connection !LibPQ.Connection !Bool !PreparedStatementRegistry.PreparedStatementRegistry
-- |
-- An error of the result-decoder.
data ResultsError =
-- |
-- An error on the client-side,
-- with a message generated by the \"libpq\" library.
-- Usually indicates problems with connection.
ClientError !(Maybe ByteString) |
-- |
-- Decoder error details.
ResultError !ResultError
deriving (Show, Eq)
-- |
-- Decoder error details.
data ResultError =
-- |
-- An error reported by the DB. Code, message, details, hint.
@ -77,14 +83,23 @@ data ResultError =
UnexpectedAmountOfRows !Int
deriving (Show, Eq)
-- |
-- An error during the decoding of a specific row.
data RowError =
-- |
-- Appears on the attempt to parse more columns than there are in the result.
EndOfInput |
-- |
-- Appears on the attempt to parse a @NULL@ as some value.
UnexpectedNull |
-- |
-- Appears when a wrong value parser is used.
-- Comes with the error details.
ValueError !Text
deriving (Show, Eq)
-- |
-- A connection acquistion error.
-- Possible details of the connection acquistion error.
type ConnectionError =
Maybe ByteString