From ffc8c3b68a775a61924ca0cd01dc8b9b97a96d09 Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 19 Apr 2011 12:23:29 +0300 Subject: [PATCH] Weird error message on syntax error, closes #864. --- .../ElasticSearchIllegalArgumentException.java | 6 ++++++ .../admin/indices/alias/RestIndicesAliasesAction.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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) {