catch IOException intead of SocketException

`NGUnixDomainSocket` throws `java.io.IOException` instead of `SocketException`, probably because `SocketException` does not expose the contructor with a `Throwable` parameter.
To allow clients to disconnect, we need to catch `IOException`.
This commit is contained in:
Eugene Yokota 2017-11-29 22:42:58 -05:00
parent d193d302f0
commit c5d578815c
2 changed files with 10 additions and 9 deletions

View File

@ -9,7 +9,8 @@ package sbt
package internal
package client
import java.net.{ URI, Socket, InetAddress, SocketException }
import java.io.IOException
import java.net.{ URI, Socket, InetAddress }
import java.util.UUID
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicReference }
import scala.collection.mutable.ListBuffer
@ -111,7 +112,7 @@ class NetworkClient(arguments: List[String]) { self =>
try {
connection.publish(bytes)
} catch {
case _: SocketException =>
case _: IOException =>
// log.debug(e.getMessage)
// toDel += client
}

View File

@ -8,7 +8,7 @@
package sbt
package internal
import java.net.SocketException
import java.io.IOException
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.atomic.AtomicInteger
import scala.collection.mutable.ListBuffer
@ -170,7 +170,7 @@ private[sbt] final class CommandExchange {
try {
c.notifyEvent(method, params)
} catch {
case _: SocketException =>
case _: IOException =>
toDel += c
}
}
@ -213,7 +213,7 @@ private[sbt] final class CommandExchange {
}
}
} catch {
case _: SocketException =>
case _: IOException =>
toDel += c
}
}
@ -225,7 +225,7 @@ private[sbt] final class CommandExchange {
try {
c.publishEvent(event)
} catch {
case _: SocketException =>
case _: IOException =>
toDel += c
}
}
@ -267,7 +267,7 @@ private[sbt] final class CommandExchange {
try {
c.publishObjectEvent(event)
} catch {
case _: SocketException =>
case _: IOException =>
toDel += c
}
}
@ -305,7 +305,7 @@ private[sbt] final class CommandExchange {
c.publishEventMessage(event)
}
} catch {
case e: SocketException =>
case e: IOException =>
toDel += c
}
}
@ -317,7 +317,7 @@ private[sbt] final class CommandExchange {
try {
c.publishEventMessage(event)
} catch {
case _: SocketException =>
case _: IOException =>
toDel += c
}
}