Skip to content

fix: preserve typed errors for S3 and GCS list requests - #857

Open
RanaPriyansh wants to merge 1 commit into
apache:mainfrom
RanaPriyansh:fix/list-error-classification-851
Open

RanaPriyansh wants to merge 1 commit into
apache:mainfrom
RanaPriyansh:fix/list-error-classification-851

Conversation

@RanaPriyansh

Copy link
Copy Markdown

Which issue does this PR close?

Closes #851.

Rationale for this change

S3 and GCS list failures currently return Generic for HTTP statuses that other operations map to specific error variants.

What changes are included in this PR?

Route list request failures through the existing RetryError::error mapper. Retain the request prefix as the error path and preserve RetryError as the source.

Add local HTTP mock tests for both providers. The tests cover collected list streams, delimiter lists, 401 responses, valid empty results, and unmapped 500 responses.

Recorded local runs passed cargo test --features aws,gcp --lib (231 tests), ordinary cargo test, formatting, and strict all-features/all-targets Clippy.
Default tests emitted four integration-macro warnings. External cloud integration tests and remote CI were not run.

Production-target Clippy checks also passed separately with aws-base and gcp-base, without default features.
A supplemental all-targets check without reqwest failed. The exact baseline produced the same existing errors.

AI assistance produced the implementation, tests, and draft text. An independent AI review inspected the diff and logs.

Are there any user-facing changes?

S3 and GCS list request failures use these existing error mappings:

  • 401: Unauthenticated
  • 403: PermissionDenied
  • 404: NotFound
  • 304: NotModified
  • 409: AlreadyExists
  • 412: Precondition

Other statuses remain Generic. Error text can change because the mapper preserves RetryError directly instead of the private list-request wrapper.

Error paths contain the actual request prefix. Public Path("prefix") list calls report "prefix/". Bucket-root calls report an empty path.
Raw paginated-list prefixes remain unchanged. No public API signatures change.

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.

List requests do not map HTTP status codes to error variants, so 403 and 404 both become Error::Generic

1 participant