static Optional < XmlElement > getErrorElement ( XmlElement rootXmlElement ) { Optional < XmlElement > elem = rootXmlElement . getChildOpt ( "error" ) ; if ( elem . isPresent ( ) ) { ApiException error = elem . transform ( toApiException ( ) ) . get ( ) ; log . error ( error . getCode ( ) + ": " + error . getValue ( ) ) ; } return elem ; }
Determines if the given XML Document contains an error message which then would printed by the logger .