- final Document errorDocument = XmlUtil.createDocumentCopy(originalErrorDocument);
- final Node rootNode = errorDocument.getFirstChild();
-
- final Node rpcErrorNode = (Node) XmlUtil.evaluateXPath(rpcErrorExpression, rootNode, XPathConstants.NODE);
-
- final Node errorTypeNode = (Node) XmlUtil.evaluateXPath(errorTypeExpression, rpcErrorNode, XPathConstants.NODE);
- errorTypeNode.setTextContent(sendErrorException.getErrorType().getTagValue());
-
- final Node errorTagNode = (Node) XmlUtil.evaluateXPath(errorTagExpression, rpcErrorNode, XPathConstants.NODE);
- errorTagNode.setTextContent(sendErrorException.getErrorTag().getTagValue());
-
- final Node errorSeverityNode = (Node) XmlUtil.evaluateXPath(errorSeverityExpression, rpcErrorNode,
- XPathConstants.NODE);
- errorSeverityNode.setTextContent(sendErrorException.getErrorSeverity().getTagValue());
-
- if (sendErrorException.getErrorInfo() != null && sendErrorException.getErrorInfo().isEmpty() == false) {
- /*
- * <error-info> <bad-attribute>message-id</bad-attribute>
- * <bad-element>rpc</bad-element> </error-info>
- */
- final Node errorInfoNode = errorDocument.createElementNS(
- XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, "error-info");
-
- errorInfoNode.setPrefix(rootNode.getPrefix());
- rpcErrorNode.appendChild(errorInfoNode);
- for (final Entry<String, String> errorInfoEntry : sendErrorException.getErrorInfo().entrySet()) {
- final Node node = errorDocument.createElementNS(
- XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, errorInfoEntry.getKey());
- node.setTextContent(errorInfoEntry.getValue());
- errorInfoNode.appendChild(node);
- }
-
+ @Override
+ public void operationComplete(final ChannelFuture channelFuture) throws Exception {
+ Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception %s", sendErrorException,
+ channelFuture.cause());