Skip to content

Move some exception translation logic to BaseServiceException #413

Description

@mziccard

In DefaultStorageRpc (and also other services as DefaultBigQueryRpc) we have code handling the translation of IOException to service specific exceptions:

privatestaticBigQueryExceptiontranslate(IOExceptionexception) {
BigQueryExceptiontranslated;
if (exceptioninstanceofGoogleJsonResponseException
&& ((GoogleJsonResponseException) exception).getDetails() != null) {
translated = translate(((GoogleJsonResponseException) exception).getDetails());
} else {
translated =
newBigQueryException(BigQueryException.UNKNOWN_CODE, exception.getMessage(), false);
}
translated.initCause(exception);
returntranslated;
}
privatestaticBigQueryExceptiontranslate(GoogleJsonErrorexception) {
booleanretryable = RETRYABLE_CODES.contains(exception.getCode());
returnnewBigQueryException(exception.getCode(), exception.getMessage(), retryable);
}

Part of this logic should be moved to BaseServiceException

Metadata

Metadata

Assignees

Labels

🚨 criticalP0 critical issue. Requires immediate fixapi: coretriage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions