From cc9c2336f545166e51c4e6bfc51fdb27d080e575 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Tue, 19 Nov 2024 14:44:38 +0000 Subject: [PATCH] improved startup error reporting --- .../distage/roles/launcher/AppFailureHandler.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/distage/distage-framework/src/main/scala/izumi/distage/roles/launcher/AppFailureHandler.scala b/distage/distage-framework/src/main/scala/izumi/distage/roles/launcher/AppFailureHandler.scala index b81684a3be..b79b77abab 100644 --- a/distage/distage-framework/src/main/scala/izumi/distage/roles/launcher/AppFailureHandler.scala +++ b/distage/distage-framework/src/main/scala/izumi/distage/roles/launcher/AppFailureHandler.scala @@ -18,7 +18,7 @@ object AppFailureHandler { } object NullHandler extends AppFailureHandler { - override def onError(t: Throwable): Unit = { + override def onError(t: Throwable): Nothing = { rethrow(t) } } @@ -36,12 +36,14 @@ object AppFailureHandler { private def report(t: Throwable): Unit = { t match { case d: ProvisioningException => - d.getSuppressed.toList.headOption match { - case Some(d: DIAppBootstrapException) => + d.getSuppressed.toList match { + case (d: DIAppBootstrapException) :: Nil=> System.err.println(d.getMessage) - case _ => // JVM will print the exception regardless + case _ => + d.printStackTrace() } case _ => + t.printStackTrace() } }