aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/Exceptions.scala
diff options
context:
space:
mode:
authorJack Koenig2019-04-26 13:10:44 -0700
committerGitHub2019-04-26 13:10:44 -0700
commita7cf6ff3416a11088d811a435ba71fd36b191fb4 (patch)
tree79e2e8c5753903ca6d14e9b952c26a07442bd980 /src/main/scala/firrtl/options/Exceptions.scala
parent99ae1d6649f1731c5dec2098b10733735232b72c (diff)
parentef8f06f23b9ee6cf86de2450752dfd0fcd32da80 (diff)
Merge pull request #1005 from freechipsproject/f764.7
Stage/Phase
Diffstat (limited to 'src/main/scala/firrtl/options/Exceptions.scala')
-rw-r--r--src/main/scala/firrtl/options/Exceptions.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/options/Exceptions.scala b/src/main/scala/firrtl/options/Exceptions.scala
new file mode 100644
index 00000000..100ff464
--- /dev/null
+++ b/src/main/scala/firrtl/options/Exceptions.scala
@@ -0,0 +1,20 @@
+// See LICENSE for license details.
+
+package firrtl.options
+
+/** Indicate a generic error in a [[Phase]]
+ * @param message exception message
+ * @param cause an underlying Exception that this wraps
+ */
+class PhaseException(val message: String, cause: Throwable = null) extends RuntimeException(message, cause)
+
+/** Indicate an error related to a bad [[firrtl.annotations.Annotation Annotation]] or it's command line option
+ * equivalent. This exception is always caught and converted to an error message by a [[Stage]]. Do not use this for
+ * communicating generic exception information.
+ */
+class OptionsException(val message: String, cause: Throwable = null) extends IllegalArgumentException(message, cause)
+
+/** Indicates that a [[Phase]] is missing some mandatory information. This likely occurs either if a user ran something
+ * out of order or if the compiler did not run things in the correct order.
+ */
+class PhasePrerequisiteException(message: String, cause: Throwable = null) extends PhaseException(message, cause)