Skip to content

Commit efe0de2

Browse files
committed
Change some to IllegalStateException since they really only can happen because of a bug
1 parent 837640a commit efe0de2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,19 +749,19 @@ private PhysicalOperation planLookupJoin(LookupJoinExec join, LocalExecutionPlan
749749
.filter(e -> RemoteClusterAware.parseClusterAlias(e.getKey()).equals(clusterAlias))
750750
.findFirst();
751751
entry = maybeEntry.orElseThrow(
752-
() -> new IllegalArgumentException(
752+
() -> new IllegalStateException(
753753
"can't plan [" + join + "]: no matching index found " + EsqlCCSUtils.inClusterName(clusterAlias)
754754
)
755755
);
756756
}
757757

758758
if (entry.getValue() != IndexMode.LOOKUP) {
759-
throw new IllegalArgumentException("can't plan [" + join + "], found index with mode [" + entry.getValue() + "]");
759+
throw new IllegalStateException("can't plan [" + join + "], found index with mode [" + entry.getValue() + "]");
760760
}
761761
String[] indexSplit = RemoteClusterAware.splitIndexName(entry.getKey());
762762
// No prefix is ok, prefix with this cluster is ok, something else is not
763763
if (indexSplit[0] != null && clusterAlias.equals(indexSplit[0]) == false) {
764-
throw new IllegalArgumentException(
764+
throw new IllegalStateException(
765765
"can't plan [" + join + "]: no matching index found " + EsqlCCSUtils.inClusterName(clusterAlias)
766766
);
767767
}

0 commit comments

Comments
 (0)