From eb9503f674b4648bce06484889f5d6163a89d234 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 16 Feb 2012 16:39:38 +0200 Subject: [PATCH] better status code when failing to parse --- .../org/elasticsearch/ElasticSearchParseException.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/elasticsearch/ElasticSearchParseException.java b/src/main/java/org/elasticsearch/ElasticSearchParseException.java index 92ecf0162ea..00bdacd3c72 100644 --- a/src/main/java/org/elasticsearch/ElasticSearchParseException.java +++ b/src/main/java/org/elasticsearch/ElasticSearchParseException.java @@ -19,6 +19,8 @@ package org.elasticsearch; +import org.elasticsearch.rest.RestStatus; + /** * */ @@ -31,4 +33,9 @@ public class ElasticSearchParseException extends ElasticSearchException { public ElasticSearchParseException(String msg, Throwable cause) { super(msg, cause); } + + @Override + public RestStatus status() { + return RestStatus.BAD_REQUEST; + } }