File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.rollover
server/src/main/java/org/elasticsearch/action/admin/indices/rollover Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 187187---
188188" Rolling over an unknown target should return 404 " :
189189 - do :
190- catch : bad_request
190+ catch : missing
191191 indices.rollover :
192192 alias : " non_existent"
193193 - match : {error.reason: "rollover target [non_existent] does not exist"}
Original file line number Diff line number Diff line change 1111
1212import org .apache .logging .log4j .LogManager ;
1313import org .apache .logging .log4j .Logger ;
14+ import org .elasticsearch .ResourceNotFoundException ;
1415import org .elasticsearch .action .admin .indices .create .CreateIndexClusterStateUpdateRequest ;
1516import org .elasticsearch .action .admin .indices .create .CreateIndexRequest ;
1617import org .elasticsearch .action .datastreams .autosharding .AutoShardingResult ;
@@ -664,7 +665,7 @@ static void validate(
664665 ) {
665666 final IndexAbstraction indexAbstraction = project .getIndicesLookup ().get (rolloverTarget );
666667 if (indexAbstraction == null ) {
667- throw new IllegalArgumentException ("rollover target [" + rolloverTarget + "] does not exist" );
668+ throw new ResourceNotFoundException ("rollover target [" + rolloverTarget + "] does not exist" );
668669 }
669670 if (VALID_ROLLOVER_TARGETS .contains (indexAbstraction .getType ()) == false ) {
670671 throw new IllegalArgumentException (
You can’t perform that action at this time.
0 commit comments