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:
parent
36f9d39205
commit
1a9c82d6b5
|
@ -19,7 +19,7 @@
|
|||
|
||||
package org.elasticsearch.action;
|
||||
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.ElasticsearchIllegalArgumentException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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<>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue