File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ public void writeTo(StreamOutput out) throws IOException {
8989 if (out .getVersion ().onOrAfter (MULTIPLE_REPOSITORIES_SUPPORT_ADDED )) {
9090 out .writeStringArray (repositories );
9191 } else {
92+ if (repositories .length != 1 ) {
93+ throw new IllegalArgumentException ("Requesting snapshots from multiple repositories is not supported in versions prior " +
94+ "to " + MULTIPLE_REPOSITORIES_SUPPORT_ADDED .toString ());
95+ }
9296 out .writeString (repositories [0 ]);
9397 }
9498 out .writeStringArray (snapshots );
Original file line number Diff line number Diff line change @@ -208,7 +208,8 @@ public void writeTo(StreamOutput out) throws IOException {
208208 }
209209 } else {
210210 if (successfulResponses .size () + failedResponses .size () != 1 ) {
211- throw new IllegalArgumentException ("snapshots from more than one repository are requested" );
211+ throw new IllegalArgumentException ("Requesting snapshots from multiple repositories is not supported in versions prior " +
212+ "to " + GetSnapshotsRequest .MULTIPLE_REPOSITORIES_SUPPORT_ADDED .toString ());
212213 }
213214
214215 if (successfulResponses .size () == 1 ) {
You can’t perform that action at this time.
0 commit comments