@Override
    public String toString() {
        String details = "";

        if (detailedMessage != null) {
            details = detailedMessage;
        }
        if (cause !=null) {
            if (details.length()>0)
                details+=": ";
            details+= com.yahoo.yolean.Exceptions.toMessageString(cause);
        }
        if (details.length()>0)
            details=" (" + details + ")";

        return "error : " + message + details;
    }
Two error messages are equal if they have the same code and message.
The cause is ignored in the comparison.
vespajlib/src/main/java/com/yahoo/protect/ErrorMessage.java