RestAPI: Change validation exceptions to respond with 400 status instead of 500.

Validation errors are clearly in the realm of client errors (a program
with the request).  Thus they should return a 4xx response code.

closes #7619
This commit is contained in:
Ryan Ernst 2014-09-06 22:01:48 -07:00
parent 36f9d39205
commit 1a9c82d6b5
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action; package org.elasticsearch.action;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchIllegalArgumentException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -27,7 +27,7 @@ import java.util.List;
/** /**
* *
*/ */
public class ActionRequestValidationException extends ElasticsearchException { public class ActionRequestValidationException extends ElasticsearchIllegalArgumentException {
private final List<String> validationErrors = new ArrayList<>(); private final List<String> validationErrors = new ArrayList<>();