NioClientManager: reduce log for IOException

* log without stacktrace
* reduce log level to info
This commit is contained in:
Andreas Schildbach 2025-02-13 10:39:37 +01:00
parent f59e6ce118
commit 26726f4648

View file

@ -88,7 +88,10 @@ public class NioClientManager extends AbstractExecutionThreadService implements
// may cause this. Otherwise it may be any arbitrary kind of connection failure.
// Calling sc.socket().getRemoteSocketAddress() here throws an exception, so we can only log the error itself
Throwable cause = Throwables.getRootCause(e);
log.warn("Failed to connect with exception: {}: {}", cause.getClass().getName(), cause.getMessage(), e);
if (cause instanceof IOException)
log.info("Failed to connect: {}: {}", cause.getClass().getName(), cause.getMessage());
else
log.warn("Failed to connect: {}: {}", cause.getClass().getName(), cause.getMessage(), e);
handler.closeConnection();
data.future.completeExceptionally(cause);
data.future = null;