Class MLException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.opensearch.ml.common.exception.MLException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ExecuteException,MLLimitExceededException,MLResourceNotFoundException,MLValidationException
Base exception thrown from MLCommons.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMLException(String message) Constructor with error message.MLException(String message, Throwable cause) Constructor with specified error message adn cause.MLException(Throwable cause) Constructor with specified cause. -
Method Summary
Modifier and TypeMethodDescriptioncountedInStats(boolean countInStats) Set if the exception should be counted in stats.booleanReturns if the exception should be counted in stats.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MLException
Constructor with error message.- Parameters:
message- message of the exception
-
MLException
Constructor with specified cause.- Parameters:
cause- exception cause
-
MLException
Constructor with specified error message adn cause.- Parameters:
message- error messagecause- exception cause
-
-
Method Details
-
isCountedInStats
public boolean isCountedInStats()Returns if the exception should be counted in stats.- Returns:
- true if should count the exception in stats; otherwise return false
-
countedInStats
Set if the exception should be counted in stats.- Parameters:
countInStats- count the exception in stats- Returns:
- the exception itself
-