org.elasticsearch
Class ElasticSearchException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.elasticsearch.ElasticSearchException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActionRequestValidationException, AlreadyExpiredException, BlobStoreException, ClusterBlockException, DiscoveryException, DumpException, ElasticSearchGenerationException, ElasticSearchIllegalArgumentException, ElasticSearchIllegalStateException, ElasticSearchInterruptedException, ElasticSearchNullPointerException, ElasticSearchParseException, ElasticSearchTimeoutException, EsRejectedExecutionException, FacetPhaseExecutionException, FailedNodeException, FailedToResolveConfigException, GatewayException, HttpException, IgnoreRecoveryException, IndexException, IndexShardAlreadyExistsException, IndexTemplateAlreadyExistsException, IndexTemplateMissingException, IndexWarmerMissingException, InvalidIndexTemplateException, JmxException, MapperException, MasterNotDiscoveredException, NodeClosedException, NoNodeAvailableException, PrimaryMissingActionException, QueryBuilderException, RecoveryFailedException, RiverException, RoutingException, RoutingMissingException, ScriptException, SearchContextMissingException, SearchException, SearchPhaseExecutionException, SearchSourceBuilderException, SettingsException, TimestampParsingException, TransportException, UnavailableShardsException, UncategorizedExecutionException

public class ElasticSearchException
extends RuntimeException

A base class for all elasticsearch exceptions.

See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElasticSearchException

public ElasticSearchException(String msg)
Construct a ElasticSearchException with the specified detail message.

Parameters:
msg - the detail message

ElasticSearchException

public ElasticSearchException(String msg,
                              Throwable cause)
Construct a ElasticSearchException with the specified detail message and nested exception.

Parameters:
msg - the detail message
cause - the nested exception
Method Detail

status

public RestStatus status()
Returns the rest status code associated with this exception.


unwrapCause

public Throwable unwrapCause()
Unwraps the actual cause from the exception for cases when the exception is a ElasticSearchWrapperException.

See Also:
ExceptionsHelper.unwrapCause(Throwable)

getDetailedMessage

public String getDetailedMessage()
Return the detail message, including the message from the nested exception if there is one.


getRootCause

public Throwable getRootCause()
Retrieve the innermost cause of this exception, if none, returns the current exception.


getMostSpecificCause

public Throwable getMostSpecificCause()
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.

Differs from getRootCause() in that it falls back to the present exception if there is no root cause.

Returns:
the most specific cause (never null)

contains

public 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.

Parameters:
exType - the exception type to look for
Returns:
whether there is a nested exception of the specified type


Copyright © 2009-2012. All Rights Reserved.