aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala')
-rw-r--r--src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala b/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
index 49d484ee..8192b416 100644
--- a/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
+++ b/src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala
@@ -43,8 +43,8 @@ case class BlackBoxResourceFileNameAnno(resourceFileName: String) extends BlackB
* @param fileName the name of the BlackBox file (only used for error message generation)
* @param e an underlying exception that generated this
*/
-class BlackBoxNotFoundException(fileName: String, e: Throwable = null) extends FIRRTLException(
- s"BlackBox '$fileName' not found. Did you misspell it? Is it in src/{main,test}/resources?", e)
+class BlackBoxNotFoundException(fileName: String, message: String) extends FirrtlUserException(
+ s"BlackBox '$fileName' not found. Did you misspell it? Is it in src/{main,test}/resources?\n$message")
/** Handle source for Verilog ExtModules (BlackBoxes)
*
@@ -136,8 +136,8 @@ object BlackBoxSourceHelper {
* @param code some code to run
*/
private def safeFile[A](fileName: String)(code: => A) = try { code } catch {
- case e@ (_: FileNotFoundException | _: NullPointerException) => throw new BlackBoxNotFoundException(fileName, e)
- case t: Throwable => throw t
+ case e @ (_: FileNotFoundException | _: NullPointerException) =>
+ throw new BlackBoxNotFoundException(fileName, e.getMessage)
}
/**