From: Robert Varga Date: Tue, 18 Oct 2022 18:59:34 +0000 (+0200) Subject: Use Future.cause() for error checking X-Git-Tag: v4.0.3~32 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F102749%2F1;p=netconf.git Use Future.cause() for error checking Include error trace when terminating session. Change-Id: I02faabd68cf8f9ad89dc0273e9a85641d12c8db6 Signed-off-by: Robert Varga --- diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index 59f3e450b9..afd77d17b1 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -179,10 +179,11 @@ public abstract class AbstractNetconfSessionNegotiator { - if (future.isSuccess()) { - LOG.debug("Channel {} closed: success", channel); + final var cause = future.cause(); + if (cause != null) { + LOG.warn("Channel {} closed: fail", channel, cause); } else { - LOG.warn("Channel {} closed: fail", channel); + LOG.debug("Channel {} closed: success", channel); } }); }