Skip to content

Commit

Permalink
Merge pull request #2551 from tgodzik/remove-unimplemented
Browse files Browse the repository at this point in the history
bugfix: Remove ??? from Bloop rifle and log properly
  • Loading branch information
tgodzik authored Jan 3, 2025
2 parents 9058c4e + 5621b46 commit 38c118d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bloop-rifle/src/main/scala/bloop/rifle/internal/Operations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ object Operations {
promise.future
}

private def nailgunClient(address: BloopRifleConfig.Address): Client =
private def nailgunClient(address: BloopRifleConfig.Address, logger: BloopRifleLogger): Client =
address match {
case BloopRifleConfig.Address.Tcp(host, port) =>
TcpClient(host, port)
Expand All @@ -306,8 +306,12 @@ object Operations {
val files = lockFiles(addr)
val res = libdaemonjvm.client.Connect.tryConnect(files)
res match {
case None => ??? // not running
case Some(Left(_)) => ??? // error
case None =>
logger.error("Nailgun server is no running")
throw new RuntimeException("Nailgun server is no running")
case Some(Left(err)) =>
logger.error(err.toString())
throw err
case Some(Right(channel)) =>
libdaemonjvm.Util.socketFromChannel(channel)
}
Expand Down Expand Up @@ -340,7 +344,7 @@ object Operations {
): BspConnection = {

val stop0 = new AtomicBoolean
val nailgunClient0 = nailgunClient(address)
val nailgunClient0 = nailgunClient(address, logger)
val streams = Streams(inOpt, out, err)

val promise = Promise[Int]()
Expand Down Expand Up @@ -460,7 +464,7 @@ object Operations {
): Int = {

val stop0 = new AtomicBoolean
val nailgunClient0 = nailgunClient(address)
val nailgunClient0 = nailgunClient(address, logger)
val streams = Streams(
inOpt,
out,
Expand Down Expand Up @@ -492,7 +496,7 @@ object Operations {
): Int = {

val stop0 = new AtomicBoolean
val nailgunClient0 = nailgunClient(address)
val nailgunClient0 = nailgunClient(address, logger)
val streams = Streams(None, out, err)

timeout(30.seconds + BloopRifleConfig.extraTimeout, scheduler, logger) {
Expand Down

0 comments on commit 38c118d

Please sign in to comment.