}
public static boolean isErrorMessage(final XmlElement xmlElement) throws NetconfDocumentedException {
+
+ // In the case of multiple rpc-error messages, size will not be 1 but we still want to report as Error
if (xmlElement.getChildElements().size() != 1) {
+ List<XmlElement> allResults = xmlElement.getChildElements();
+ for (XmlElement result : allResults) {
+ if (result.getName().equals(DocumentedException.RPC_ERROR)) {
+ return true;
+ }
+ }
return false;
}
try {
// Extract child element <capabilities> from <hello> with or without(fallback) the same namespace
Optional<XmlElement> capabilitiesElement = responseElement
.getOnlyChildElementWithSameNamespaceOptionally(XmlNetconfConstants.CAPABILITIES);
- if (!capabilitiesElement.isPresent()) {
+ if (capabilitiesElement.isEmpty()) {
capabilitiesElement = responseElement.getOnlyChildElementOptionally(XmlNetconfConstants.CAPABILITIES);
}