Class ElasticsearchExceptionTranslator
java.lang.Object
org.springframework.data.elasticsearch.client.elc.ElasticsearchExceptionTranslator
- All Implemented Interfaces:
PersistenceExceptionTranslator
public class ElasticsearchExceptionTranslator
extends Object
implements PersistenceExceptionTranslator
Simple
PersistenceExceptionTranslator for Elasticsearch. Convert the given runtime exception to an
appropriate exception from the org.springframework.dao hierarchy. Return null if no translation is
appropriate: any other exception may have resulted from user code, and should not be translated.- Since:
- 4.4
- Author:
- Peter-Josef Meisch, Junghoon Ban
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchExceptionTranslator(co.elastic.clients.json.JsonpMapper jsonpMapper) -
Method Summary
Modifier and TypeMethodDescriptiontranslateException(Throwable throwable) translates an Exception if possible.
-
Constructor Details
-
ElasticsearchExceptionTranslator
public ElasticsearchExceptionTranslator(co.elastic.clients.json.JsonpMapper jsonpMapper)
-
-
Method Details
-
translateException
translates an Exception if possible. Exceptions that are noRuntimeExceptions are wrapped in a RuntimeException- Parameters:
throwable- the Exception to map- Returns:
- the potentially translated RuntimeException.
-
translateExceptionIfPossible
- Specified by:
translateExceptionIfPossiblein interfacePersistenceExceptionTranslator
-