From 5adacbf1a5506464fa5ff65a1b680582ac8ca7b3 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:33:33 -0800 Subject: [PATCH] Error: use nested error message in WithCode --- scalafmt-core/shared/src/main/scala/org/scalafmt/Error.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/Error.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/Error.scala index c7ad8c3108..11dc6282b6 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/Error.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/Error.scala @@ -120,6 +120,7 @@ object Error { case object MegaTestFailed extends Error("Mega test failed.") - case class WithCode(error: Throwable, code: String) extends Exception(error) + case class WithCode(error: Throwable, code: String) + extends Exception(error.getMessage, error) }