mirror of https://github.com/sbt/sbt.git
Merge pull request #8109 from harpocrates/bsp-compile-status-code
fix: BSP error status code in more cases
This commit is contained in:
commit
25b30ff36e
|
|
@ -789,11 +789,19 @@ object BuildServerProtocol {
|
|||
Keys.compile.result.value match {
|
||||
case Value(_) => StatusCode.Success
|
||||
case Inc(cause) =>
|
||||
cause.getCause match {
|
||||
case _: CompileFailed => StatusCode.Error
|
||||
case _: InterruptedException => StatusCode.Cancelled
|
||||
case err => throw 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)
|
||||
}
|
||||
|
||||
statusCodeOpt.getOrElse(throw cause)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue