From df8e221aef147ded6e8fe7331619913cc2f51513 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 8 Jan 2011 09:09:11 +0100 Subject: Fully qualified errors --- src/Hakyll/Core/DirectedGraph/DependencySolver.hs | 5 ++++- src/Hakyll/Core/DirectedGraph/Internal.hs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Hakyll/Core/DirectedGraph') diff --git a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs index 17a4b69..214211b 100644 --- a/src/Hakyll/Core/DirectedGraph/DependencySolver.hs +++ b/src/Hakyll/Core/DirectedGraph/DependencySolver.hs @@ -60,8 +60,11 @@ order temp stack set graph@(DirectedGraph graph') -- one first... (dep : _) -> if (nodeTag dep) `S.member` set -- The dependency is already in our stack - cycle detected! - then error "order: Cycle detected!" -- TODO: Dump cycle + then cycleError -- Continue with the dependency else order temp (dep : node : stackTail) (S.insert (nodeTag dep) set) graph + where + cycleError = error $ "Hakyll.Core.DirectedGraph.DependencySolver.order: " + ++ "Cycle detected!" -- TODO: Dump cycle diff --git a/src/Hakyll/Core/DirectedGraph/Internal.hs b/src/Hakyll/Core/DirectedGraph/Internal.hs index 52a712d..bc9cd92 100644 --- a/src/Hakyll/Core/DirectedGraph/Internal.hs +++ b/src/Hakyll/Core/DirectedGraph/Internal.hs @@ -24,8 +24,11 @@ data Node a = Node -- appendNodes :: Ord a => Node a -> Node a -> Node a appendNodes (Node t1 n1) (Node t2 n2) - | t1 /= t2 = error "appendNodes: Appending differently tagged nodes" + | t1 /= t2 = error' | otherwise = Node t1 (n1 `S.union` n2) + where + error' = error $ "Hakyll.Core.DirectedGraph.Internal.appendNodes: " + ++ "Appending differently tagged nodes" -- | Type used to represent a directed graph -- -- cgit v1.2.3