private static void appendStackTrace(StringBuilder b, Throwable ex, String prefix) {
        b.append(prefix).append(ex).append('\n');
        for (StackTraceElement stackElement : ex.getStackTrace()) {
            b.append("\t\tat ").append(stackElement).append('\n');
        }
        if (ex.getCause() != null) {
            b.append("\tCaused by: ");
            appendStackTrace(b, ex.getCause(), "");
        }
    }
Special handling for printing out a {@code CompositeException}.
Loops through all inner exceptions and prints them out.

@param s stream to print to
core/src/main/java/com/linecorp/armeria/common/util/CompositeException.java