Skip to content

Commit b5f6a20

Browse files
committed
Suggest users to clean working directory when Nailgun server failed
1 parent b1d1e3d commit b5f6a20

File tree

1 file changed

+7
-1
lines changed
  • modules/bloop-rifle/src/main/scala/scala/build/blooprifle/internal

1 file changed

+7
-1
lines changed

modules/bloop-rifle/src/main/scala/scala/build/blooprifle/internal/Operations.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ object Operations {
339339
}
340340
val runnable: Runnable = logger.runnable(threadName) { () =>
341341
val maybeRetCode = Try {
342-
nailgunClient0.run(
342+
val retCode = nailgunClient0.run(
343343
"bsp",
344344
protocolArgs,
345345
workingDir,
@@ -349,6 +349,12 @@ object Operations {
349349
stop0,
350350
interactiveSession = false
351351
)
352+
if (retCode != 0)
353+
logger.error(
354+
s"""Bloop 'bsp' command exited with code $retCode. Something may be wrong with the current configuration.
355+
|Running the ${Console.BOLD}clean${Console.RESET} sub-command to clear the working directory and remove caches might help.
356+
|If the error persists, please report the issue as a bug and attach a log with increased verbosity by passing ${Console.BOLD}-v -v -v${Console.RESET}.""".stripMargin)
357+
retCode
352358
}
353359
try promise.complete(maybeRetCode)
354360
catch { case _: IllegalStateException => }

0 commit comments

Comments
 (0)