diff --git a/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/NamedPipeSocket.java b/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/NamedPipeSocket.java index fd080d90f..384b18033 100644 --- a/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/NamedPipeSocket.java +++ b/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/NamedPipeSocket.java @@ -15,7 +15,7 @@ import java.nio.channels.AsynchronousFileChannel; import java.nio.channels.Channels; import java.nio.channels.CompletionHandler; -import java.nio.file.NoSuchFileException; +import java.nio.file.FileSystemException; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.concurrent.CompletableFuture; @@ -57,7 +57,7 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException { ) ); break; - } catch (NoSuchFileException e) { + } catch (FileSystemException e) { if (System.currentTimeMillis() - startedAt >= timeout) { throw new RuntimeException(e); } else { diff --git a/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/NamedPipeSocket.java b/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/NamedPipeSocket.java index f63e92019..69f283fe0 100644 --- a/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/NamedPipeSocket.java +++ b/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/NamedPipeSocket.java @@ -15,7 +15,7 @@ import java.nio.channels.AsynchronousFileChannel; import java.nio.channels.Channels; import java.nio.channels.CompletionHandler; -import java.nio.file.NoSuchFileException; +import java.nio.file.FileSystemException; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.concurrent.CompletableFuture; @@ -58,7 +58,7 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException { ) ); break; - } catch (NoSuchFileException e) { + } catch (FileSystemException e) { if (System.currentTimeMillis() - startedAt >= timeout) { throw new RuntimeException(e); } else {