/** * Parses the result and returns the failure description. * * @param result the result of executing an operation * * @return the failure description if defined, otherwise a new undefined model node * * @throws IllegalArgumentException if the outcome of the operation was successful */ public static ModelNode getFailureDescription(final ModelNode result) { if (isSuccessfulOutcome(result)) { throw ControllerClientMessages.MESSAGES.noFailureDescription(); } if (result.hasDefined(FAILURE_DESCRIPTION)) { return result.get(FAILURE_DESCRIPTION); } return new ModelNode(); }