Skip to content

Commit

Permalink
Provide an error message if VERSION is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
eunikolsky committed Dec 17, 2021
1 parent 71c22b2 commit a398266
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Lib.hs
Expand Up @@ -100,7 +100,9 @@ vcardParser = runMaybeT $ do
, cbVersionCorrect = versionCorrect
}
<- lift $ execWriterT (someTill contentline (string "END:VCARD" *> eol))
lift $ guard versionCorrect
-- TODO this reports an error on the next line after the "END:VCARD"; ideally
-- it should do that on that line
lift $ unless versionCorrect $ fail "vCard must have a VERSION"
-- _ :: Maybe Birthday -> MaybeT Parser Birthday
-- MaybeT :: m (Maybe a) -> MaybeT m a
birthday :: Birthday <- MaybeT $ pure maybeBirthday
Expand Down

0 comments on commit a398266

Please sign in to comment.