Skip to content

Commit eb16648

Browse files
committed
refactor to simplify the code
1 parent 7b7970d commit eb16648

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,7 @@ public BaseServiceException(IOException exception, boolean idempotent) {
161161
// In cases where an exception is an instance of HttpResponseException but not
162162
// an instance of GoogleJsonResponseException, check the status code to determine whether it's retryable
163163
code = ((HttpResponseException) exception).getStatusCode();
164-
Set<Error> retryableErrors = getRetryableErrors();
165-
if (retryableErrors != null && !retryableErrors.isEmpty()) {
166-
for (Error e : retryableErrors) {
167-
if (e.getCode() != null && e.getCode().equals(code)) {
168-
Error error = new Error(code, null);
169-
retryable = isRetryable(idempotent, error);
170-
break;
171-
}
172-
}
173-
}
164+
retryable = isRetryable(idempotent, new Error(code, null));
174165
}
175166
}
176167
this.retryable = MoreObjects.firstNonNull(retryable, isRetryable(idempotent, exception));

0 commit comments

Comments
 (0)