public static String toMessageString(Throwable t) {
        StringBuilder b = new StringBuilder();
        String lastMessage = null;
        String message;
        for (; t != null; t = t.getCause()) {
            message = getMessage(t);
            if (message == null) continue;
            if (message.isEmpty()) continue;
            if (message.equals(lastMessage)) continue;
            if (b.length() > 0) {
                b.append(": ");
            }
            b.append(message);
            lastMessage = message;
        }
        return b.toString();
    }
<p>Returns a user friendly error message string which includes information from all nested exceptions.</p>

<p>The form of this string is
<code>e.getMessage(): e.getCause().getMessage(): e.getCause().getCause().getMessage()...</code>
In addition, some heuristics are used to clean up common cases where exception nesting causes bad messages.
vespajlib/src/main/java/com/yahoo/yolean/Exceptions.java