Repository navigation
Conversation
61307fb to
10eee04
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new overload for ApiExceptionFactory.createException that accepts a StatusCode.Code enum directly, simplifying exception creation by internally wrapping the code in a private CodeOnlyStatusCode implementation. This change allows the removal of redundant statusCodeOf helper methods, such as the one in ResumableUploadFutureImpl. A unit test was also added to verify the new overload. The reviewer suggested making the new createException overload public instead of package-private to ensure consistency with other public factory methods and allow its use across different packages.
|
|
| return createException(message, cause, new CodeOnlyStatusCode(code), retryable); | ||
| } | ||
|
|
||
| private static final class CodeOnlyStatusCode implements StatusCode { |
There was a problem hiding this comment.
Non-blocking: This might be subjective, but I think the name CodeOnlyStatusCode is not easy to comprehend. Following the naming convention of GrpcStatusCode and HttpJsonStatusCode, maybe LocalStatusCode? Also adding javadocs to explaining the use cases of this class would also be great.





Context: comment thread on #14425. This will be useful for upcoming work on the resumable upload stall control feature.