Revert "fix: BSP error status code in more cases"

This commit is contained in:
kenji yoshida 2025-05-11 12:59:15 +09:00 committed by GitHub
parent 25b30ff36e
commit 1d7871233b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 12 deletions

View File

@ -789,19 +789,11 @@ object BuildServerProtocol {
Keys.compile.result.value match {
case Value(_) => StatusCode.Success
case Inc(cause) =>
var statusCodeOpt: Option[Int]
def updateCode(code: Int): Unit =
statusCodeOpt = Some(statusCodeOpt match {
case None => code
case Some(oldCode) => oldCode.max(code)
})
Incomplete.visitAll(cause.getCause) {
case _: CompileFailed => updateCode(StatusCode.Error)
case _: InterruptedException => updateCode(StatusCode.Cancelled)
cause.getCause match {
case _: CompileFailed => StatusCode.Error
case _: InterruptedException => StatusCode.Cancelled
case err => throw cause
}
statusCodeOpt.getOrElse(throw cause)
}
}