From 18650016fcfead0e05012c691f3465ee524a7075 Mon Sep 17 00:00:00 2001 From: Brice Jaglin Date: Fri, 24 Jun 2022 23:50:32 +0200 Subject: [PATCH] don't swallow strack traces on unchecked exception --- src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala b/src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala index 59fa9c2e..13c7b7ed 100644 --- a/src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala +++ b/src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala @@ -101,7 +101,9 @@ class ScalafixInterface private ( def rulesThatWillRun(): Seq[ScalafixRule] = try scalafixArguments.rulesThatWillRun().asScala - catch { case NonFatal(e) => throw new InvalidArgument(e.getMessage) } + catch { + case e: ScalafixException => throw new InvalidArgument(e.getMessage) + } def validate(): Option[ScalafixException] = Option(scalafixArguments.validate().orElse(null))