in cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/SpannerExceptionUtil.java [90:103]
private static R2dbcException createR2dbcException(
int errorCode, String message, @Nullable Throwable baseException) {
switch (errorCode) {
case Code.ALREADY_EXISTS_VALUE:
return new R2dbcDataIntegrityViolationException(message, null, errorCode, baseException);
case Code.INVALID_ARGUMENT_VALUE:
return new R2dbcBadGrammarException(message, null, errorCode, baseException);
case Code.PERMISSION_DENIED_VALUE:
return new R2dbcPermissionDeniedException(message, null, errorCode, baseException);
default:
return new R2dbcNonTransientResourceException(message, null, errorCode, baseException);
}
}