Skip to content

Commit

Permalink
Allow problems to be cleaned up after compiler crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jchyb committed Sep 9, 2024
1 parent 5757dd8 commit 615db68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/src/main/scala/bloop/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import bloop.util.BestEffortUtils
import bloop.util.BestEffortUtils.BestEffortProducts
import bloop.rtexport.RtJarCache
import java.nio.file.Paths
import java.io.PrintWriter
import java.io.StringWriter

case class CompileInputs(
scalaInstance: ScalaInstance,
Expand Down Expand Up @@ -736,9 +738,13 @@ object Compiler {
Result.Failed(failedProblems, None, elapsed, backgroundTasks, None)
case t: Throwable =>
t.printStackTrace()
val sw = new StringWriter()
t.printStackTrace(new PrintWriter(sw))
logger.info(sw.toString())
val backgroundTasks =
toBackgroundTasks(backgroundTasksForFailedCompilation.toList)
Result.Failed(Nil, Some(t), elapsed, backgroundTasks, None)
val failedProblems = findFailedProblems(reporter, None)
Result.Failed(failedProblems, Some(t), elapsed, backgroundTasks, None)
}
}
}
Expand Down

0 comments on commit 615db68

Please sign in to comment.