1
1
mirror of https://github.com/srid/rib.git synced 2024-11-30 03:45:00 +03:00

Have Shake report errors with filename

This commit is contained in:
Sridhar Ratnakumar 2019-11-26 15:03:56 -05:00
parent f8014e92f0
commit ac07ae7ffe

View File

@ -94,7 +94,13 @@ readDocMulti pat = do
readDoc readDoc
! #relpath f ! #relpath f
! #path (input </> f) ! #path (input </> f)
pure $ either (error . showMarkupError @t) id result case result of
Left e ->
-- FIXME: There is one more place, getDocumentMeta, which throws error
-- (and thus not handled here)
let es = toString (showMarkupError @t e)
in fail $ "Error converting " <> toFilePath f <> " to HTML: " <> es
Right v -> pure v
-- | Build a single HTML file with the given value -- | Build a single HTML file with the given value
buildHtml :: Path Rel File -> Html () -> Action () buildHtml :: Path Rel File -> Html () -> Action ()