private static String formatMessage(final Throwable t) {
        StringBuilder b = new StringBuilder();
        Throwable cause = t;
        while (cause != null) {
            StackTraceElement[] trace = cause.getStackTrace();
            String currentMsg = cause.getMessage();

            if (b.length() > 0) {
                b.append(": ");
            }
            b.append(t.getClass().getSimpleName()).append('(');
            if (currentMsg != null) {
                b.append('"').append(currentMsg).append('"');
            }
            b.append(')');
            if (trace.length > 0) {
                b.append(" at ").append(trace[0].getClassName()).append('(');
                if (trace[0].getFileName() != null) {
                    b.append(trace[0].getFileName()).append(':')
                            .append(trace[0].getLineNumber());
                }
                b.append(')');
            }
            cause = cause.getCause();
        }
        return b.toString();
    }
Update if serializable contents are added.
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/ExceptionWrapper.java