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))