Skip to content

Commit 78b4168

Browse files
authored
ESQL: Throw ISE instead of IAE for illegal block in page (#128960)
IAE gets reported as a 400 status code, but that's inappropriate when inconsistent pages are always bugs, and should be reported with a 500. Throw ISE instead.
1 parent 29e68bd commit 78b4168

File tree

2 files changed

+6
-1
lines changed
  • docs/changelog
  • x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data

2 files changed

+6
-1
lines changed

docs/changelog/128960.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 128960
2+
summary: Throw ISE instead of IAE for illegal block in page
3+
area: ES|QL
4+
type: bug
5+
issues: []

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/Page.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private Page(boolean copyBlocks, int positionCount, Block[] blocks) {
8484
private Page(Page prev, Block[] toAdd) {
8585
for (Block block : toAdd) {
8686
if (prev.positionCount != block.getPositionCount()) {
87-
throw new IllegalArgumentException(
87+
throw new IllegalStateException(
8888
"Block [" + block + "] does not have same position count: " + block.getPositionCount() + " != " + prev.positionCount
8989
);
9090
}

0 commit comments

Comments
 (0)