aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/graph
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/firrtl/graph')
-rw-r--r--src/main/scala/firrtl/graph/DiGraph.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/graph/DiGraph.scala b/src/main/scala/firrtl/graph/DiGraph.scala
index 450ec4ff..135603ff 100644
--- a/src/main/scala/firrtl/graph/DiGraph.scala
+++ b/src/main/scala/firrtl/graph/DiGraph.scala
@@ -7,7 +7,7 @@ import scala.collection.mutable
import scala.collection.mutable.{LinkedHashSet, LinkedHashMap}
/** An exception that is raised when an assumed DAG has a cycle */
-class CyclicException extends Exception("No valid linearization for cyclic graph")
+class CyclicException(val node: Any) extends Exception(s"No valid linearization for cyclic graph, found at $node")
/** An exception that is raised when attempting to find an unreachable node */
class PathNotFoundException extends Exception("Unreachable node")
@@ -79,7 +79,7 @@ class DiGraph[T] private[graph] (private[graph] val edges: LinkedHashMap[T, Link
def visit(n: T): Unit = {
if (tempMarked.contains(n)) {
- throw new CyclicException
+ throw new CyclicException(n)
}
if (unmarked.contains(n)) {
tempMarked += n