Package org.elasticsearch.index.query
Class QueryValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- org.elasticsearch.common.ValidationException
-
- org.elasticsearch.index.query.QueryValidationException
-
- All Implemented Interfaces:
Serializable
public class QueryValidationException extends ValidationException
This exception can be used to indicate various reasons why validation of a query has failed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryValidationException()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QueryValidationExceptionaddValidationError(String queryId, String validationError, QueryValidationException validationException)Helper method than can be used to add error messages to an existingQueryValidationException.static QueryValidationExceptionaddValidationErrors(List<String> validationErrors, QueryValidationException validationException)Helper method than can be used to add error messages to an existingQueryValidationException.-
Methods inherited from class org.elasticsearch.common.ValidationException
addValidationError, addValidationErrors, getMessage, validationErrors
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
addValidationError
public static QueryValidationException addValidationError(String queryId, String validationError, QueryValidationException validationException)
Helper method than can be used to add error messages to an existingQueryValidationException. When passingnullas the initial exception, a new exception is created.- Parameters:
queryId- the query that caused the errorvalidationError- the error message to add to an initial exceptionvalidationException- an initial exception. Can benull, in which case a new exception is created.- Returns:
- a
QueryValidationExceptionwith added validation error message
-
addValidationErrors
public static QueryValidationException addValidationErrors(List<String> validationErrors, QueryValidationException validationException)
Helper method than can be used to add error messages to an existingQueryValidationException. When passingnullas the initial exception, a new exception is created.- Parameters:
validationErrors- the error messages to add to an initial exceptionvalidationException- an initial exception. Can benull, in which case a new exception is created.- Returns:
- a
QueryValidationExceptionwith added validation error message
-
-