@@ -17,6 +17,7 @@ import qualified Data.Map as M
1717import Data.Monoid (mempty)
1818import Data.Set (Set)
1919import qualified Data.Set as S
20+import System.Exit (ExitCode (..), exitWith)
2021import System.FilePath ((</>))
2122
2223
@@ -76,12 +77,15 @@ run configuration rules = do
7677 -- Run the program and fetch the resulting state
7778 result <- runErrorT $ runRWST build read' state
7879 case result of
79− Left e -> Logger.error logger e
80− Right (_, s, _) -> Store.set store factsKey $ runtimeFacts s
81−
82− -- Flush and return
83− Logger.flush logger
84− return ruleSet
80+ Left e -> do
81+ Logger.error logger e
82+ Logger.flush logger
83+ exitWith $ ExitFailure 1
84+
85+ Right (_, s, _) -> do
86+ Store.set store factsKey $ runtimeFacts s
87+ Logger.flush logger
88+ return ruleSet
8589 where
8690 factsKey = ["Hakyll.Core.Runtime.run", "facts"]
8791