Interface R2dbcExceptionMapper
- All Superinterfaces:
io.micronaut.core.order.Ordered
public interface R2dbcExceptionMapper
extends io.micronaut.core.order.Ordered
The
R2dbcException
mapper interface. Can be used to map given R2dbc exceptions to some custom exceptions
(for example DataAccessException
and its descendents like OptimisticLockException
).- Since:
- 4.8.0
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescription@NonNull Dialect
@Nullable DataAccessException
mapR2dbcException
(@NonNull io.r2dbc.spi.R2dbcException r2dbcException) MapsR2dbcException
to customDataAccessException
.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
getDialect
- Returns:
- the
Dialect
that this mapper supports
-
mapR2dbcException
@Nullable @Nullable DataAccessException mapR2dbcException(@NonNull @NonNull io.r2dbc.spi.R2dbcException r2dbcException) MapsR2dbcException
to customDataAccessException
. In case when mapper is not able to mapR2dbcException
to customDataAccessException
then result will be null indicating that mapper cannot map the exception.- Parameters:
r2dbcException
- The R2dbc exception- Returns:
- mapped
DataAccessException
fromR2dbcException
or if mapper cannot mapR2dbcException
then returns null
-