summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Runtime.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Runtime.hs')
-rw-r--r--src/Hakyll/Core/Runtime.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Hakyll/Core/Runtime.hs b/src/Hakyll/Core/Runtime.hs
index 23c24b1..a66e4b5 100644
--- a/src/Hakyll/Core/Runtime.hs
+++ b/src/Hakyll/Core/Runtime.hs
@@ -17,6 +17,7 @@ import qualified Data.Map as M
import Data.Monoid (mempty)
import Data.Set (Set)
import qualified Data.Set as S
+import System.Exit (ExitCode (..), exitWith)
import System.FilePath ((</>))
@@ -76,12 +77,15 @@ run configuration rules = do
-- Run the program and fetch the resulting state
result <- runErrorT $ runRWST build read' state
case result of
- Left e -> Logger.error logger e
- Right (_, s, _) -> Store.set store factsKey $ runtimeFacts s
-
- -- Flush and return
- Logger.flush logger
- return ruleSet
+ Left e -> do
+ Logger.error logger e
+ Logger.flush logger
+ exitWith $ ExitFailure 1
+
+ Right (_, s, _) -> do
+ Store.set store factsKey $ runtimeFacts s
+ Logger.flush logger
+ return ruleSet
where
factsKey = ["Hakyll.Core.Runtime.run", "facts"]