Fix error messages
This commit is contained in:
parent
cf2055f39e
commit
68d747f605
@ -86,14 +86,14 @@ readInt bs = case BS.length bs of
|
|||||||
4 -> pure $ fromIntegral $ readBigEndian @Int32 bs
|
4 -> pure $ fromIntegral $ readBigEndian @Int32 bs
|
||||||
8 -> pure $ fromIntegral $ readBigEndian @Int bs
|
8 -> pure $ fromIntegral $ readBigEndian @Int bs
|
||||||
2 -> pure $ fromIntegral $ readBigEndian @Int16 bs
|
2 -> pure $ fromIntegral $ readBigEndian @Int16 bs
|
||||||
_ -> fail "Wrong number bytes for integer"
|
_ -> fail "Wrong number of bytes for integer"
|
||||||
|
|
||||||
readWord :: Num a => ByteString -> Parser a
|
readWord :: Num a => ByteString -> Parser a
|
||||||
readWord bs = case BS.length bs of
|
readWord bs = case BS.length bs of
|
||||||
4 -> pure $ fromIntegral $ readBigEndian @Word32 bs
|
4 -> pure $ fromIntegral $ readBigEndian @Word32 bs
|
||||||
8 -> pure $ fromIntegral $ readBigEndian @Word bs
|
8 -> pure $ fromIntegral $ readBigEndian @Word bs
|
||||||
2 -> pure $ fromIntegral $ readBigEndian @Word16 bs
|
2 -> pure $ fromIntegral $ readBigEndian @Word16 bs
|
||||||
_ -> fail "Wrong number bytes for word"
|
_ -> fail "Wrong number of bytes for word"
|
||||||
|
|
||||||
-- | See https://www.postgresql.org/docs/current/datatype-numeric.html.
|
-- | See https://www.postgresql.org/docs/current/datatype-numeric.html.
|
||||||
-- We assume that 'Int' has 64 bits. This is not guaranteed but reasonable enough.
|
-- We assume that 'Int' has 64 bits. This is not guaranteed but reasonable enough.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user