You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2023/04/16 13:43:21 UTC
[GitHub] [druid] gianm commented on a diff in pull request #14093: Nicer error message for CSV with no properties.
gianm commented on code in PR #14093:
URL: https://github.com/apache/druid/pull/14093#discussion_r1167927465
##########
processing/src/main/java/org/apache/druid/indexer/Checks.java:
##########
@@ -36,12 +37,18 @@ public static <T> Property<T> checkOneNotNullOrEmpty(List<Property<T>> propertie
if (nonNullProperty == null) {
nonNullProperty = property;
} else {
- throw new IAE("At most one of %s must be present", properties);
+ throw new IAE(
+ "At most one of %s must be present",
+ properties.stream().map(Property::getName).collect(Collectors.toList())
Review Comment:
IMO, with the interpolation it's clear, it'll look like:
```
At most one of properties[[a, b]] must be present
```
##########
processing/src/main/java/org/apache/druid/indexer/Checks.java:
##########
@@ -36,12 +37,18 @@ public static <T> Property<T> checkOneNotNullOrEmpty(List<Property<T>> propertie
if (nonNullProperty == null) {
nonNullProperty = property;
} else {
- throw new IAE("At most one of %s must be present", properties);
+ throw new IAE(
+ "At most one of %s must be present",
Review Comment:
👍 Changed it to: `At most one of properties[%s] must be present` to also make it more obvious we're talking about properties.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org