From fc48b14c36f124a0fb4ae4b0578bb7da054a8b80 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Thu, 16 Nov 2023 14:33:58 +0100 Subject: [PATCH] chore: Add full error stack trace --- .../src/main/scala/bloop/engine/tasks/CompileTask.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/main/scala/bloop/engine/tasks/CompileTask.scala b/frontend/src/main/scala/bloop/engine/tasks/CompileTask.scala index 091011b5dd..4a198343d1 100644 --- a/frontend/src/main/scala/bloop/engine/tasks/CompileTask.scala +++ b/frontend/src/main/scala/bloop/engine/tasks/CompileTask.scala @@ -22,6 +22,7 @@ import bloop.engine.tasks.compilation._ import bloop.io.ParallelOps import bloop.io.ParallelOps.CopyMode import bloop.io.{Paths => BloopPaths} +import bloop.logging.BloopLogger import bloop.logging.DebugFilter import bloop.logging.Logger import bloop.logging.LoggerAction @@ -36,7 +37,6 @@ import bloop.tracing.BraveTracer import monix.execution.CancelableFuture import monix.reactive.MulticastStrategy import monix.reactive.Observable - object CompileTask { private implicit val logContext: DebugFilter = DebugFilter.Compilation def compile[UseSiteLogger <: Logger]( @@ -292,10 +292,8 @@ object CompileTask { } else { results.foreach { case FinalNormalCompileResult.HasException(project, err) => - val errMsg = err.fold(identity, _.getMessage) - rawLogger.error(s"Unexpected error when compiling ${project.name}: '$errMsg'") - err.foreach(_.printStackTrace(System.err)) - err.foreach(rawLogger.trace(_)) + val errMsg = err.fold(identity, BloopLogger.prettyPrintException) + rawLogger.error(s"Unexpected error when compiling ${project.name}: $errMsg") case _ => () // Do nothing when the final compilation result is not an actual error }