Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Report IOExceptions in AbstractNioSender.isConnected() with a meaning…
Browse files Browse the repository at this point in the history
…ful message #126
  • Loading branch information
mp911de committed Jan 29, 2018
1 parent e5df6f7 commit 5eab85c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.IOException;
import java.net.InetAddress;
import java.net.PortUnreachableException;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
Expand Down Expand Up @@ -74,8 +75,11 @@ protected boolean isConnected() throws IOException {

try {
return channel.read(byteBuffer) >= 0;
} catch (PortUnreachableException e) {
errorReporter.reportError("Port " + getHost() + ":" + getPort() + " not reachable", e);
} catch (IOException e) {
errorReporter.reportError(e.getMessage(), e);
errorReporter.reportError("Cannot verify whether channel to " + getHost() + ":" + getPort() + " is connected: "
+ e.getMessage(), e);
}
}

Expand Down

0 comments on commit 5eab85c

Please sign in to comment.