+ /**
+ * Checks if netconf error was sent successfully.
+ */
+ private static final class SendErrorVerifyingListener implements ChannelFutureListener {
+ private final NetconfDocumentedException sendErrorException;
+
+ public SendErrorVerifyingListener(final NetconfDocumentedException sendErrorException) {
+ this.sendErrorException = sendErrorException;
+ }
+
+ @Override
+ public void operationComplete(final ChannelFuture channelFuture) throws Exception {
+ Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception {}", sendErrorException,
+ channelFuture.cause());
+ }
+ }