diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java b/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java index eac49adbe9e..48ab291de8d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java @@ -19,6 +19,8 @@ package org.elasticsearch; +import org.elasticsearch.rest.RestStatus; + /** * @author kimchy (Shay Banon) */ @@ -35,4 +37,8 @@ public class ElasticSearchIllegalArgumentException extends ElasticSearchExceptio public ElasticSearchIllegalArgumentException(String msg, Throwable cause) { super(msg, cause); } + + @Override public RestStatus status() { + return RestStatus.BAD_REQUEST; + } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/RestIndicesAliasesAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/RestIndicesAliasesAction.java index 0ca90923a4c..974093bdf37 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/RestIndicesAliasesAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/RestIndicesAliasesAction.java @@ -110,8 +110,8 @@ public class RestIndicesAliasesAction extends BaseRestHandler { channel.sendResponse(new XContentThrowableRestResponse(request, e)); } catch (IOException e1) { logger.warn("Failed to send response", e1); - return; } + return; } client.admin().indices().aliases(indicesAliasesRequest, new ActionListener() { @Override public void onResponse(IndicesAliasesResponse response) {