Skip to content

Commit 5dbd201

Browse files
Add ignored errno code in domain socket stuff
1 parent 1d99790 commit 5dbd201

File tree

1 file changed

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

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ object Operations {
134134
promise.future
135135
}
136136

137+
private val ignoredErrnos = Set(
138+
61, // Connection refused
139+
111 //
140+
)
141+
137142
/** Opens a BSP connection to a running bloop server.
138143
*
139144
* Starts a thread to read output from the nailgun connection, and another one to pass input to
@@ -232,10 +237,10 @@ object Operations {
232237
catch {
233238
case ex: IOException
234239
if ex.getCause.isInstanceOf[NativeErrorException] &&
235-
ex.getCause.asInstanceOf[NativeErrorException].returnCode == 111 =>
240+
ignoredErrnos(ex.getCause.asInstanceOf[NativeErrorException].returnCode) =>
236241
logger.debug(s"Error when connecting to $socketFile: ${ex.getMessage}")
237242
null
238-
case e: NativeErrorException if e.returnCode == 111 =>
243+
case e: NativeErrorException if ignoredErrnos(e.returnCode) =>
239244
logger.debug(s"Error when connecting to $socketFile: ${e.getMessage}")
240245
null
241246
}

0 commit comments

Comments
 (0)