public static String getFailureDescriptionAsString ( final ModelNode result ) { if ( isSuccessfulOutcome ( result ) ) { return "" ; } final String msg ; if ( result . hasDefined ( ClientConstants . FAILURE_DESCRIPTION ) ) { if ( result . hasDefined ( ClientConstants . OP ) ) { msg = String . format ( "Operation '%s' at address '%s' failed: %s" , result . get ( ClientConstants . OP ) , result . get ( ClientConstants . OP_ADDR ) , result . get ( ClientConstants . FAILURE_DESCRIPTION ) ) ; } else { msg = String . format ( "Operation failed: %s" , result . get ( ClientConstants . FAILURE_DESCRIPTION ) ) ; } } else { msg = String . format ( "An unexpected response was found checking the deployment. Result: %s" , result ) ; } return msg ; }
Parses the result and returns the failure description . If the result was successful an empty string is returned .