@Override
    public boolean equals(Object o) {
        if (!(o instanceof ErrorMessage)) return false;

        ErrorMessage other = (ErrorMessage) o;

        if (this.code != other.code) return false;

        if (!this.message.equals(other.message)) return false;

        if (this.detailedMessage==null) return other.detailedMessage==null;
        if (other.detailedMessage==null) return false;

        return this.detailedMessage.equals(other.detailedMessage);
    }
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