Package org.elasticsearch.xpack.esql
Class ExceptionUtils
java.lang.Object
org.elasticsearch.xpack.esql.ExceptionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertIllegalState(Boolean condition, String message) We generally prefer to avoid assertions in production code, as they can kill the entire node if they fail, instead of just failing a given test.static voidassertIllegalState(Supplier<Boolean> condition, String message) We generally prefer to avoid assertions in production code, as they can kill the entire node if they fail, instead of just failing a given test.static VerificationExceptionmath(Source source, ArithmeticException e) Create aVerificationExceptionfrom anArithmeticExceptionthrown because of an invalid math expression.
-
Constructor Details
-
ExceptionUtils
public ExceptionUtils()
-
-
Method Details
-
math
Create aVerificationExceptionfrom anArithmeticExceptionthrown because of an invalid math expression.- Parameters:
source- the invalid part of the query causing the exceptione- the exception that was thrown- Returns:
- an exception with a user-readable error message with http code 400
-
assertIllegalState
We generally prefer to avoid assertions in production code, as they can kill the entire node if they fail, instead of just failing a given test. So instead, we throw anIllegalStateException. Like proper asserts, this will only be executed if assertions are enabled. -
assertIllegalState
We generally prefer to avoid assertions in production code, as they can kill the entire node if they fail, instead of just failing a given test. So instead, we throw anIllegalStateException. Like proper asserts, this will only be executed if assertions are enabled.
-