code: private ValidationMessage<Origin> reportError(ValidationResult result, Origin origin, String messageId,
                                                    Object... params) {
          ValidationMessage<Origin> message =
                  EntryValidations.createMessage(origin, Severity.ERROR, messageId, params);
          result.append(message);
          return message;
      }
docs: Adds error to the result.
  
  @param result a reference to validation result
  @param origin the origin