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 9b1b8f6 commit 6a92110
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 @@ -45,6 +45,8 @@ import bloop.Compiler.Result.Failed
import bloop.util.BestEffortUtils
import bloop.util.BestEffortUtils.BestEffortProducts
import java.nio.file.Paths
import java.io.PrintWriter
import java.io.StringWriter

case class CompileInputs(
scalaInstance: ScalaInstance,
Expand Down Expand Up @@ -733,9 +735,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 6a92110

Please sign in to comment.