public class ElasticsearchException extends RuntimeException
Modifier and Type | Class and Description |
---|---|
static class |
ElasticsearchException.WithRestHeaders
A base class for exceptions that should carry rest headers
|
Constructor and Description |
---|
ElasticsearchException(String msg)
Construct a
ElasticsearchException with the specified detail message. |
ElasticsearchException(String msg,
Throwable cause)
Construct a
ElasticsearchException with the specified detail message
and nested exception. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Class exType)
Check whether this exception contains an exception of the given type:
either it is of the given class itself or it contains a nested cause
of the given type.
|
String |
getDetailedMessage()
Return the detail message, including the message from the nested exception
if there is one.
|
Throwable |
getMostSpecificCause()
Retrieve the most specific cause of this exception, that is,
either the innermost cause (root cause) or this exception itself.
|
Throwable |
getRootCause()
Retrieve the innermost cause of this exception, if none, returns the current exception.
|
RestStatus |
status()
Returns the rest status code associated with this exception.
|
Throwable |
unwrapCause()
Unwraps the actual cause from the exception for cases when the exception is a
ElasticsearchWrapperException . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ElasticsearchException(String msg)
ElasticsearchException
with the specified detail message.msg
- the detail messagepublic RestStatus status()
public Throwable unwrapCause()
ElasticsearchWrapperException
.ExceptionsHelper.unwrapCause(Throwable)
public String getDetailedMessage()
public Throwable getRootCause()
public Throwable getMostSpecificCause()
Differs from getRootCause()
in that it falls back
to the present exception if there is no root cause.
null
)public boolean contains(Class exType)
exType
- the exception type to look forCopyright © 2009–2015. All rights reserved.