@Override
    public String validate(String value) {
      try {
        if (value == null) {
          return "Value cannot be null";
        }
        if (!type.inRange(value.trim(), lower, upper)) {
          return "Invalid value  " + value + ", which should be in between " + lower + " and " + upper;
        }
      } catch (Exception e) {
        return e.toString();
      }
      return null;
    }
validate value for a ConfVar, return non-null string for fail message
common/src/java/org/apache/hadoop/hive/conf/Validator.java