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 DataAccessExceptionmapR2dbcException(@NonNull io.r2dbc.spi.R2dbcException r2dbcException) MapsR2dbcExceptionto customDataAccessException.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
getDialect
- Returns:
- the
Dialectthat this mapper supports
-
mapR2dbcException
@Nullable @Nullable DataAccessException mapR2dbcException(@NonNull @NonNull io.r2dbc.spi.R2dbcException r2dbcException) MapsR2dbcExceptionto customDataAccessException. In case when mapper is not able to mapR2dbcExceptionto customDataAccessExceptionthen result will be null indicating that mapper cannot map the exception.- Parameters:
r2dbcException- The R2dbc exception- Returns:
- mapped
DataAccessExceptionfromR2dbcExceptionor if mapper cannot mapR2dbcExceptionthen returns null
-