@FunctionalInterface public interface CqlExceptionTranslator extends org.springframework.dao.support.PersistenceExceptionTranslator
DriverExceptios and Spring's data access
strategy-agnostic DataAccessException hierarchy.DataAccessException,
2.0| Modifier and Type | Method and Description |
|---|---|
default org.springframework.dao.DataAccessException |
translate(String task,
String cql,
com.datastax.driver.core.exceptions.DriverException ex)
Translate the given
DriverException into a generic DataAccessException. |
default org.springframework.dao.DataAccessException translate(@Nullable
String task,
@Nullable
String cql,
com.datastax.driver.core.exceptions.DriverException ex)
DriverException 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.DriverException.NestedRuntimeException.getRootCause()Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.