@@ -12,6 +12,7 @@ import Control.Monad.Reader (ask)
12import Control.Monad.RWS (RWST, runRWST)
12import Control.Monad.RWS (RWST, runRWST)
13import Control.Monad.State (get, modify)
13import Control.Monad.State (get, modify)
14import Control.Monad.Trans (liftIO)
14import Control.Monad.Trans (liftIO)
15+import Data.List (intercalate)
15import Data.Map (Map)
16import Data.Map (Map)
16import qualified Data.Map as M
17import qualified Data.Map as M
17import Data.Monoid (mempty)
18import Data.Monoid (mempty)
@@ -171,7 +172,9 @@ pickAndChase = do
171--------------------------------------------------------------------------------
172--------------------------------------------------------------------------------
172chase :: [Identifier] -> Identifier -> Runtime ()
173chase :: [Identifier] -> Identifier -> Runtime ()
173chase trail id'
174chase trail id'
174− | id' `elem` trail = return () -- Cycle detected!
175+ | id' `elem` trail = throwError $ "Hakyll.Core.Runtime.chase: " ++
176+ "Dependency cycle detected: " ++ intercalate " depends on "
177+ (map show $ dropWhile (/= id') (reverse trail) ++ [id'])
175 | otherwise = do
178 | otherwise = do
176 logger <- runtimeLogger <$> ask
179 logger <- runtimeLogger <$> ask
177 todo <- runtimeTodo <$> get
180 todo <- runtimeTodo <$> get