code: static MolgenisValidationException translateInvalidIntegerException(PSQLException pSqlException) {
      ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
      String message = serverErrorMessage.getMessage();
      Matcher matcher =
          Pattern.compile("invalid input syntax for \\b(?:type )?\\b(.+?): \"(.*?)\"")
              .matcher(message);
      boolean matches = matcher.matches();
      if (!matches) {
        throw new RuntimeException(ERROR_TRANSLATING_EXCEPTION_MSG, pSqlException);
      }
      String postgreSqlType = matcher.group(1);
  
      // convert PostgreSQL data type to attribute type:
      String type;
      switch (postgreSqlType) {
        case "boolean":
          type = BOOL.toString();
          break;
        case "date":
          type = DATE.toString();
          break;
        case "timestamp with time zone":
          type = DATE_TIME.toString();
          break;
        case "double precision":
          type = DECIMAL.toString();
          break;
        case "integer":
          type = INT.toString() + " or " + LONG.toString();
          break;
        default:
          type = postgreSqlType;
          break;
      }
      String value = matcher.group(2);
  
      ConstraintViolation constraintViolation =
          new ConstraintViolation(
              format("Value [%s] of this entity attribute is not of type [%s].", value, type), null);
      return new MolgenisValidationException(singleton(constraintViolation));
    }
docs: Package private for testability
  
  @param pSqlException PostgreSQL exception
  @return translated validation exception