Skip to content

Improve error message for the error case where a request using Reques… #6254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Jul 14, 2025

Motivation and Context

#6174

Modifications

Improve error message for the error case where a request using RequestBody#fromInputStream failed to retry due to lack of mark and reset support

Before:

java.lang.IllegalStateException: The request content has fewer bytes than the specified content-length: 14 bytes.

After:

java.lang.IllegalStateException: Content input stream does not support mark/reset

Testing

Added unit test

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@zoewangg zoewangg requested a review from a team as a code owner July 14, 2025 16:24
@zoewangg zoewangg added the no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required label Jul 14, 2025
@L-Applin
Copy link
Contributor

Checkstyle violation because IoUtils is not used anymore:

2025-07-14T16:35:33.1335405Z [ERROR] /codebuild/output/src621856621/src/github.com/aws/aws-sdk-java-v2/core/sdk-core/src/main/java/software/amazon/awssdk/core/sync/RequestBody.java:41:8: Unused import - software.amazon.awssdk.utils.IoUtils. [UnusedImports]

beside that, all good

…tBody#fromInputStream failed to retry due to lack of mark and reset support
@zoewangg zoewangg force-pushed the zoewang/requestBodyFromInputStreamFix branch from 7ef0f4b to 287eb66 Compare July 14, 2025 21:08
@zoewangg zoewangg enabled auto-merge July 14, 2025 21:08
Copy link

@zoewangg zoewangg added this pull request to the merge queue Jul 14, 2025
Merged via the queue into master with commit d85bab4 Jul 14, 2025
35 of 36 checks passed
Copy link

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2025
@zoewangg zoewangg deleted the zoewang/requestBodyFromInputStreamFix branch August 15, 2025 17:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants