ConnectionFactoryUtils.convertR2dbcException(String, String, R2dbcException)instead.
@FunctionalInterface @Deprecated public interface R2dbcExceptionTranslator
R2dbcExceptionsand Spring's data access strategy-agnostic
Implementations can be generic (for example, using
for R2DBC) or wholly proprietary (for example, using Oracle error codes) for greater precision.
@Nullable DataAccessException translate(String task, @Nullable String sql, R2dbcException ex)
R2dbcExceptioninto a generic
The returned DataAccessException is supposed to contain the original
R2dbcException 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 R2dbcException check (and subsequent cast) is considered
reliable when expecting R2DBC-based access to have happened.
task- readable text describing the task being attempted.
sql- SQL query or update that caused the problem (if known).
ex- the offending
R2dbcException, or null if no translation could be applied (in a custom translator; the default translators always throw an
UncategorizedR2dbcExceptionin such a case).
Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.