From 78e5a0d290329a908d262a5114e9d191f137347f Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 18 Oct 2022 20:59:34 +0200 Subject: [PATCH] Use Future.cause() for error checking Include error trace when terminating session. Change-Id: I02faabd68cf8f9ad89dc0273e9a85641d12c8db6 Signed-off-by: Robert Varga --- .../nettyutil/AbstractNetconfSessionNegotiator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } }); } -- 2.36.6