diff options
author | Jason Tedor <jason@tedor.me> | 2017-06-30 17:50:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 17:50:20 -0400 |
commit | c70c44005088d4bf0eb7fc5d6f8660c25958a785 (patch) | |
tree | 5dbcaf4be194c655c7d4b643c449b71e14550a94 /rest-api-spec/src/main | |
parent | 6deb18c0de1ba060984a2ce4de22dd065a49456d (diff) |
Adjust status on bad allocation explain requests
When a user requests a cluster allocation explain in a situation where
it does not make sense (for example, there are no unassigned shards), we
should consider this a bad request instead of a server error. Yet, today
by throwing an illegal state exception, these are treated as server
errors. This commit adjusts these so that they throw illegal argument
exceptions and are treated as bad requests.
Relates #25503
Diffstat (limited to 'rest-api-spec/src/main')
-rw-r--r-- | rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml index 6ec8651fe8..5e1bc42ec4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml @@ -1,14 +1,19 @@ ---- -"cluster shard allocation explanation test": +"bad cluster shard allocation explanation request": - skip: - version: " - 5.1.99" - reason: explain API response output was changed starting in 5.2.0 + version: " - 5.99.99" + reason: response status on bad request was changed starting in 5.6.0 - do: # there aren't any unassigned shards to explain - catch: /illegal_state_exception/ + catch: /illegal_argument_exception/ cluster.allocation_explain: {} +--- +"cluster shard allocation explanation test": + - skip: + version: " - 5.1.99" + reason: explain API response output was changed starting in 5.2.0 + - do: indices.create: index: test |