Skip to content

Commit 548fe0e

Browse files
Use IllegalArgumentException when state is used in mixed cluster
1 parent 64d3729 commit 548fe0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetSnapshotsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
137137
} else if (clusterSupportsFeature.test(GetSnapshotsFeatures.GET_SNAPSHOTS_STATE_PARAMETER)) {
138138
getSnapshotsRequest.states(EnumSet.copyOf(Arrays.stream(stateString.split(",")).map(SnapshotState::valueOf).toList()));
139139
} else {
140-
throw new IllegalStateException("[state] parameter is not supported on all nodes in the cluster");
140+
throw new IllegalArgumentException("[state] parameter is not supported on all nodes in the cluster");
141141
}
142142

143143
// Consume these response parameters used in SnapshotInfo now, to avoid assertion errors in BaseRestHandler for requests where they

0 commit comments

Comments
 (0)