/** * Translate the given {@link DriverException} into a generic {@link DataAccessException}. * * @param task readable text describing the task being attempted * @param cql CQL query or update that caused the problem (may be {@literal null}) * @param ex the offending {@code RuntimeException}. * @return the exception translation {@link Function} * @see CqlProvider */ protected DataAccessException translateException(String task, @Nullable String cql, DriverException ex) { return translate(task, cql, ex); }
/** * Translate the given {@link DriverException} into a generic {@link DataAccessException}. * * @param task readable text describing the task being attempted * @param cql CQL query or update that caused the problem (may be {@literal null}) * @param ex the offending {@code RuntimeException}. * @return the translated {@link DataAccessException} or {@literal null} if translation not possible. * @see CqlProvider */ @Nullable protected DataAccessException translateExceptionIfPossible(String task, @Nullable String cql, RuntimeException ex) { return (ex instanceof DriverException ? translate(task, cql, (DriverException) ex) : null); }