Class OpenSearchExceptionTranslator

java.lang.Object
org.opensearch.data.client.orhlc.OpenSearchExceptionTranslator
All Implemented Interfaces:
org.springframework.dao.support.PersistenceExceptionTranslator

public class OpenSearchExceptionTranslator extends Object implements org.springframework.dao.support.PersistenceExceptionTranslator
Simple PersistenceExceptionTranslator for OpenSearch. 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:
0.1
  • Constructor Details

    • OpenSearchExceptionTranslator

      public OpenSearchExceptionTranslator()
  • Method Details

    • translateException

      public RuntimeException translateException(Throwable throwable)
      translates an Exception if possible. Exceptions that are no RuntimeExceptions are wrapped in a RuntimeException
      Parameters:
      throwable - the Exception to map
      Returns:
      the potentially translated RuntimeException.
    • translateExceptionIfPossible

      public org.springframework.dao.DataAccessException translateExceptionIfPossible(RuntimeException ex)
      Specified by:
      translateExceptionIfPossible in interface org.springframework.dao.support.PersistenceExceptionTranslator