Skip to content

Commit 8085eea

Browse files
authored
Change exceptions to IllegalArgumentException in GroupingDocValuesSelector (elastic#128348)
1 parent 6aed71f commit 8085eea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/lucene/grouping/GroupingDocValuesSelector.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void setNextReader(LeafReaderContext readerContext) throws IOException {
100100
public boolean advanceExact(int target) throws IOException {
101101
if (sorted.advanceExact(target)) {
102102
if (sorted.docValueCount() > 1) {
103-
throw new IllegalStateException(
103+
throw new IllegalArgumentException(
104104
"failed to extract doc:" + target + ", the grouping field must be single valued"
105105
);
106106
}
@@ -124,7 +124,7 @@ public long longValue() throws IOException {
124124
};
125125
}
126126
}
127-
default -> throw new IllegalStateException("unexpected doc values type " + type + "` for field `" + field + "`");
127+
default -> throw new IllegalArgumentException("unexpected doc values type " + type + "` for field `" + field + "`");
128128
}
129129
}
130130

@@ -200,7 +200,7 @@ public void setNextReader(LeafReaderContext readerContext) throws IOException {
200200
public boolean advanceExact(int target) throws IOException {
201201
if (sorted.advanceExact(target)) {
202202
if (sorted.docValueCount() > 1) {
203-
throw new IllegalStateException(
203+
throw new IllegalArgumentException(
204204
"failed to extract doc:" + target + ", the grouping field must be single valued"
205205
);
206206
}
@@ -233,7 +233,7 @@ public int getValueCount() {
233233
};
234234
}
235235
}
236-
default -> throw new IllegalStateException("unexpected doc values type " + type + "` for field `" + field + "`");
236+
default -> throw new IllegalArgumentException("unexpected doc values type " + type + "` for field `" + field + "`");
237237
}
238238
}
239239

0 commit comments

Comments
 (0)