@FunctionalInterface public interface CqlExceptionTranslator extends PersistenceExceptionTranslator
driver exceptions and Spring's data access
strategy-agnostic DataAccessException hierarchy.DataAccessException,
2.0| Modifier and Type | Method and Description |
|---|---|
default DataAccessException |
translate(String task,
String cql,
RuntimeException ex)
Translate the given
RuntimeException into a generic DataAccessException. |
translateExceptionIfPossibledefault DataAccessException translate(@Nullable String task, @Nullable String cql, RuntimeException ex)
RuntimeException into a generic DataAccessException.
The returned DataAccessException is supposed to contain the original DriverException as root cause.
However, client code may not generally rely on this due to DataAccessExceptions possibly being caused by
other resource APIs as well. That said, a getRootCause() instanceof DataAccessException check (and
subsequent cast) is considered reliable when expecting Cassandra-based access to have happened.
task - readable text describing the task being attempted.cql - CQL query or update that caused the problem (may be null).ex - the offending DriverException.RuntimeException.NestedRuntimeException.getRootCause()Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.