Skip to content

feat(gax): standardize mapping terminal resumable upload exceptions to ApiException - #14624

Draft
whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-errors
Draft

whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-errors

Conversation

@whowes

@whowes whowes commented Oct 9, 2026

Copy link
Copy Markdown
Contributor
  • Local failures (IOException, IllegalStateException, etc.) are now wrapped in UnknownException with the original exception as getCause(), matching GAX's usual convention (results in quite a few updated test assertions).
  • Removed manual URL suffixes from ResumableUploadChunkCoordinator and onTimeout(); toTerminalException now appends the session URL (when available) at the future boundary.
  • closePayload(@Nullable Throwable) now attaches any payload.close() failure via addSuppressed() instead of swallowing it.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors resumable upload error handling by removing the upload URL from RewindableStreamBuffer and centralizing exception formatting in ResumableUploadFutureImpl.toTerminalException. It also improves stream cleanup by propagating suppressed exceptions during payload closure. The review feedback highlights two important improvements: adding a null check in toTerminalException to prevent a potential NullPointerException when the input exception is null, and narrowing the caught exception type in closePayload from Throwable to Exception to avoid intercepting critical JVM errors.

@whowes
whowes force-pushed the whowes/resumable-upload-errors branch from f91032c to 95bf1aa Compare October 10, 2026 00:01
@whowes
whowes force-pushed the whowes/resumable-upload-errors branch from 95bf1aa to 461fc12 Compare October 10, 2026 00:14
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant