protected static void throwableMessage()

in src/main/java/org/apache/easyant/core/ant/listerners/DefaultEasyAntLogger.java [37:71]


    protected static void throwableMessage(StringBuilder m, Throwable error, boolean verbose) {

        while (error != null) {
            Throwable cause = error.getCause();
            if (cause == null) {
                break;
            }
            String msg1 = error.toString();
            String msg2 = cause.toString();
            if (msg1.endsWith(msg2)) {
                String messageException = msg1.substring(0, msg1.length() - msg2.length());
                if (error instanceof BuildException) {
                    BuildException be = (BuildException) error;

                    // wipe location information
                    if (be.getLocation() != null) {
                        messageException = messageException.substring(be.getLocation().toString().length());

                    }
                }
                m.append("Error : ").append(messageException);
                m.append(lSep);
                m.append("Cause : ");
                error = cause;
            } else {
                break;
            }
        }

        if (verbose) {
            m.append(StringUtils.getStackTrace(error));
        } else {
            m.append(error.getMessage()).append(lSep);
        }
    }