diff options
| author | Jack Koenig | 2019-08-19 23:45:07 -0700 |
|---|---|---|
| committer | GitHub | 2019-08-19 23:45:07 -0700 |
| commit | d1a682f47935009215f56664cefae0de26e2eabf (patch) | |
| tree | 2dac347abf87dcfd0018cb4e42d563c2bd78050d /src/main/scala/firrtl/transforms | |
| parent | 0f6b9615213a2a9770974ff71b3da3f6b770a772 (diff) | |
Refactor exceptions to remove stack trace from user errors (#1157)
Diffstat (limited to 'src/main/scala/firrtl/transforms')
| -rw-r--r-- | src/main/scala/firrtl/transforms/BlackBoxSourceHelper.scala | 8 |
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) } /** |
