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

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.
configgen/src/main/java/com/yahoo/config/codegen/MakeConfig.java