private static void appendException()

in gflog-core/src/main/java/com/epam/deltix/gflog/core/service/LogEntryUtil.java [17:55]


    private static void appendException(final Throwable e,
                                        final LogLimitedEntry entry,
                                        final int indent,
                                        final int depth) {

        if (entry.truncated()) {
            return;
        }

        if (depth > DEPTH_LIMIT) {
            entry.append(">>(Cyclic Exception?)>>");
            return;
        }

        entry.append(e.getClass().getName());

        final String message = e.getMessage();
        if (message != null) {
            entry.append(": ");
            entry.append(message);
        }

        entry.append(LINE_SEPARATOR);

        final StackTraceElement[] stack = e.getStackTrace();
        if (stack != null) {
            appendStack(stack, entry, indent);
        }

        final Throwable[] suppresses = e.getSuppressed();
        if (suppresses != null) {
            appendSuppresses(suppresses, entry, indent, depth);
        }

        final Throwable cause = e.getCause();
        if (cause != null) {
            appendCause(cause, entry, indent, depth);
        }
    }