Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Tweak parsing errors more
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Jan 3, 2023
1 parent 5d617f9 commit 63ce108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/Schema/Migrations/Filesystem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ missingFields fs =
migrationFromFields :: Migration -> [(Text, Text)] -> Either Text Migration
migrationFromFields m [] = pure m
migrationFromFields m ((name, value):rest) = do
processor <- maybe (Left $ "unrecognized name: " <> name) pure $ lookup name fieldProcessors
processor <- maybe (Left $ "unrecognized field: " <> name) pure $ lookup name fieldProcessors
newM <- first (\e -> "failed processing " <> name <> ": " <> e) $ processor value m
migrationFromFields newM rest

Expand All @@ -190,7 +190,7 @@ setTimestamp value m = do
ts <- case readTimestamp value of
((t, ""):_) -> Right t
[(t, _)] -> Right t
_ -> Left "value did not parse as UTCTime"
_ -> Left $ "value did not parse as UTCTime: " <> value
return $ m { mTimestamp = Just ts }

readTimestamp :: Text -> [(UTCTime, String)]
Expand Down

0 comments on commit 63ce108

Please sign in to comment.