Skip to content

Commit

Permalink
improve error message for FromField UTCTime and FromField Day
Browse files Browse the repository at this point in the history
  • Loading branch information
adamse committed Oct 6, 2020
1 parent 4939058 commit 9d07ab4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Database/SQLite/Simple/FromField.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ instance FromField UTCTime where
fromField f@(Field (SQLText t) _) =
case parseUTCTime t of
Right t -> Ok t
Left e -> returnError ConversionFailed f ("couldn't parse UTCTime field: " ++ e)
Left e -> returnError ConversionFailed f ("couldn't parse UTCTime field: " ++ e ++ ", field contents: " ++ T.unpack t)

fromField f = returnError ConversionFailed f "expecting SQLText column type"

Expand All @@ -190,7 +190,7 @@ instance FromField Day where
fromField f@(Field (SQLText t) _) =
case parseDay t of
Right t -> Ok t
Left e -> returnError ConversionFailed f ("couldn't parse Day field: " ++ e)
Left e -> returnError ConversionFailed f ("couldn't parse Day field: " ++ e ++ ", field contents: " ++ T.unpack t)

fromField f = returnError ConversionFailed f "expecting SQLText column type"

Expand Down

0 comments on commit 9d07ab4

Please sign in to comment.