Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Socket createSocket() {
try {
return UnixSocket.get(socketPath);
} catch (IOException e) {
throw new RuntimeException(e);
throw new RuntimeException("Failed create socket with path " + socketPath, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.SocketException;
Expand All @@ -24,7 +25,8 @@ public class UnixSocket extends AbstractSocket {
public static Socket get(String path) throws IOException {
try {
return new UnixSocket(path);
} catch (Exception e) {
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
IllegalAccessException e) {
//noinspection deprecation
return DomainSocket.get(path);
}
Expand All @@ -34,7 +36,8 @@ public static Socket get(String path) throws IOException {

private final SocketChannel socketChannel;

private UnixSocket(String path) throws Exception {
private UnixSocket(String path) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
IllegalAccessException, IOException {
Class<?> unixDomainSocketAddress = Class.forName("java.net.UnixDomainSocketAddress");
this.socketAddress =
(SocketAddress) unixDomainSocketAddress.getMethod("of", String.class)
Expand Down