summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Runtime.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-01-20 21:55:40 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2013-01-20 21:55:40 +0100
commit46ae23d3269cbf980e435b818b81cb6285b2cfc3 (patch)
tree7a9cb86102c1a1ce2fd6036cc074e2042b278b9b /src/Hakyll/Core/Runtime.hs
parent87735f9778d759da7059a0e8d00c91e888a06673 (diff)
downloadhakyll-46ae23d3269cbf980e435b818b81cb6285b2cfc3.tar.gz
Fix dependency cycle issue
Diffstat (limited to 'src/Hakyll/Core/Runtime.hs')
-rw-r--r--src/Hakyll/Core/Runtime.hs5
1 files changed, 4 insertions, 1 deletions
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