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

Skip to content

Commit 564c7d3

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

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 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,7 @@ 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 | IllegalAccessException e) {
2829
//noinspection deprecation
2930
return DomainSocket.get(path);
3031
}
@@ -34,7 +35,7 @@ public static Socket get(String path) throws IOException {
3435

3536
private final SocketChannel socketChannel;
3637

37-
private UnixSocket(String path) throws Exception {
38+
private UnixSocket(String path) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException {
3839
Class<?> unixDomainSocketAddress = Class.forName("java.net.UnixDomainSocketAddress");
3940
this.socketAddress =
4041
(SocketAddress) unixDomainSocketAddress.getMethod("of", String.class)

0 commit comments

Comments
 (0)
0