src/main/java/org/jboss/loom/utils/as7/AS7CliUtils.java
private static void throwIfFailure(final ModelNode node) throws CliBatchException {
        if( wasSuccess( node ) )
            return;
        
        final String msg;
        if (node.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
            if (node.hasDefined(ClientConstants.OP)) {
                msg = String.format("Operation '%s' at address '%s' failed: %s", node.get(ClientConstants.OP), node.get(ClientConstants.OP_ADDR), node.get(ClientConstants.FAILURE_DESCRIPTION));
            } else {
                msg = String.format("Operation failed: %s", node.get(ClientConstants.FAILURE_DESCRIPTION));
            }
        } else {
            msg = String.format("Operation failed: %s", node);
        }
        throw new CliBatchException(msg, node);
    }
/**
     *  If the result is an error, throw an exception.
     */
If the result is an error, throw an exception.
If the result is an error throw an exception .
private static void throwIfFailure(final ModelNode node) throws CliBatchException {
        if( wasSuccess( node ) )
            return;
        final String msg;
        if (node.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
            if (node.hasDefined(ClientConstants.OP)) {
                msg = String.format("Operation '%s' at address '%s' failed: %s", node.get(ClientConstants.OP), node.get(ClientConstants.OP_ADDR), node.get(ClientConstants.FAILURE_DESCRIPTION));
            } else {
                msg = String.format("Operation failed: %s", node.get(ClientConstants.FAILURE_DESCRIPTION));
            }
        } else {
            msg = String.format("Operation failed: %s", node);
        }
        throw new CliBatchException(msg, node);
    }
private static void throwIfFailure ( final ModelNode node ) throws CliBatchException { if ( wasSuccess ( node ) ) return ; final String msg ; if ( node . hasDefined ( ClientConstants . FAILURE_DESCRIPTION ) ) { if ( node . hasDefined ( ClientConstants . OP ) ) { msg = String . format ( "Operation '%s' at address '%s' failed: %s" , node . get ( ClientConstants . OP ) , node . get ( ClientConstants . OP_ADDR ) , node . get ( ClientConstants . FAILURE_DESCRIPTION ) ) ; } else { msg = String . format ( "Operation failed: %s" , node . get ( ClientConstants . FAILURE_DESCRIPTION ) ) ; } } else { msg = String . format ( "Operation failed: %s" , node ) ; } throw new CliBatchException ( msg , node ) ; }
If the result is an error, throw an exception.
If the result is an error throw an exception .