8000 Don't swallow IOException caused by opening socket · docker-java/docker-java@2e91373 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e91373

Browse files
committed
Don't swallow IOException caused by opening socket
1 parent 079797f commit 2e91373

File tree

1 file changed

+5
-2
lines changed
  • docker-java-transport/src/main/java/com/github/dockerjava/transport

1 file changed

+5
-2
lines changed

docker-java-transport/src/main/java/com/github/dockerjava/transport/UnixSocket.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.IOException;
44
import java.io.InputStream;
55
import java.io.OutputStream;
6+
import java.lang.reflect.InvocationTargetException;
67
import java.net.Socket;
78
import java.net.SocketAddress;
89
import java.net.SocketException;
@@ -24,7 +25,8 @@ public class UnixSocket extends AbstractSocket {
2425
public static Socket get(String path) throws IOException {
2526
try {
2627
return new UnixSocket(path);
27-
} catch (Exception e) {
28+
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
29+
IllegalAccessException e) {
2830
//noinspection deprecation
2931
return DomainSocket.get(path);
3032
}
@@ -34,7 +36,8 @@ public static Socket get(String path) throws IOException {
3436

3537
private final SocketChannel socketChannel;
3638

37-
private UnixSocket(String path) throws Exception {
39+
private UnixSocket(String path) throws ClassNotFoundException, NoSuchMethodException, Invocati 4DD6 onTargetException,
40+
IllegalAccessException, IOException {
3841
Class<?> unixDomainSocketAddress = Class.forName("java.net.UnixDomainSocketAddress");
3942
this.socketAddress =
4043
(SocketAddress) unixDomainSocketAddress.getMethod("of", String.class)

0 commit comments

Comments
 (0)
0