From: Robert Varga Date: Wed, 1 Jun 2022 16:55:31 +0000 (+0200) Subject: Move logging out of try/catch block X-Git-Tag: v4.0.0~56 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=commitdiff_plain;h=22755ee880d798830f42cc0d60e84c8602fe3794 Move logging out of try/catch block We are catching just IOException, there is no point to include logging in the block. Change-Id: I4650513ea444b506068182586153a627bfaff2b9 Signed-off-by: Robert Varga --- diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java index 213b4c1330..0d2f6e1aa5 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java @@ -140,10 +140,10 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { private synchronized void handleSshAuthenticated(final NettyAwareClientSession newSession, final ChannelHandlerContext ctx) { - try { - LOG.debug("SSH session authenticated on channel: {}, server version: {}", ctx.channel(), - newSession.getServerVersion()); + LOG.debug("SSH session authenticated on channel: {}, server version: {}", ctx.channel(), + newSession.getServerVersion()); + try { channel = newSession.createSubsystemChannel(SUBSYSTEM, ctx); channel.setStreaming(ClientChannel.Streaming.Async); channel.open().addListener(future -> { @@ -153,8 +153,6 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { handleSshSetupFailure(ctx, future.getException()); } }); - - } catch (final IOException e) { handleSshSetupFailure(ctx, e); }