From 46ae23d3269cbf980e435b818b81cb6285b2cfc3 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 20 Jan 2013 21:55:40 +0100 Subject: Fix dependency cycle issue --- src/Hakyll/Core/Runtime.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Hakyll/Core/Runtime.hs') diff --git a/src/Hakyll/Core/Runtime.hs b/src/Hakyll/Core/Runtime.hs index 39d72a7..b7dc4e8 100644 --- a/src/Hakyll/Core/Runtime.hs +++ b/src/Hakyll/Core/Runtime.hs @@ -12,6 +12,7 @@ import Control.Monad.Reader (ask) import Control.Monad.RWS (RWST, runRWST) import Control.Monad.State (get, modify) import Control.Monad.Trans (liftIO) +import Data.List (intercalate) import Data.Map (Map) import qualified Data.Map as M import Data.Monoid (mempty) @@ -171,7 +172,9 @@ pickAndChase = do -------------------------------------------------------------------------------- chase :: [Identifier] -> Identifier -> Runtime () chase trail id' - | id' `elem` trail = return () -- Cycle detected! + | id' `elem` trail = throwError $ "Hakyll.Core.Runtime.chase: " ++ + "Dependency cycle detected: " ++ intercalate " depends on " + (map show $ dropWhile (/= id') (reverse trail) ++ [id']) | otherwise = do logger <- runtimeLogger <$> ask todo <- runtimeTodo <$> get -- cgit v1.2.3