Merge pull request #6573 from github-samuel-clarenc/bspStartTry

[BSP] Send information when server process fails
This commit is contained in:
eugene yokota 2021-07-28 12:53:50 -04:00 committed by GitHub
commit 31a04c9968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -364,9 +364,14 @@ class NetworkClient(
.directory(arguments.baseDirectory)
.redirectInput(Redirect.PIPE)
processBuilder.environment.put(Terminal.TERMINAL_PROPS, props)
val process = processBuilder.start()
Try(processBuilder.start()) match {
case Success(process) =>
sbtProcess.set(process)
Some(process)
case Failure(e) =>
if (log) console.appendLog(Level.Error, s"Failed to start server : $e")
throw new ServerFailedException
}
case _ =>
if (log) {
console.appendLog(Level.Info, "sbt server is booting up")