Skip to content

fix(s3): preserve bucket service error details#211

Open
overtrue wants to merge 1 commit into
mainfrom
codex/fix-issue-210-service-error
Open

fix(s3): preserve bucket service error details#211
overtrue wants to merge 1 commit into
mainfrom
codex/fix-issue-210-service-error

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 22, 2026

Related issue

Fixes #210.

Evidence / reproduction

Issue #210 shows both rc mb local/test/ and rc ls local returning only Network error: service error against a RustFS endpoint. The bucket-level SDK paths were using SdkError::to_string(), which can collapse service responses to that generic text.

Root cause

list_buckets and create_bucket did not use the existing SDK error formatter, so backend error codes from headers such as x-amz-error-code were lost.

Fix

Use the shared format_sdk_error helper for bucket listing and creation errors, and add regression tests proving service error codes are preserved.

Validation

  • cargo test -p rc-s3 preserves_service_error_code --lib
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • git diff --check

Copilot AI review requested due to automatic review settings May 22, 2026 13:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes loss of backend S3 service error details for bucket-level operations by routing list_buckets and create_bucket failures through the shared SDK error formatter, ensuring service error codes (e.g., from x-amz-error-code) are preserved in user-facing errors.

Changes:

  • Use S3Client::format_sdk_error when mapping AWS SDK errors for list_buckets and create_bucket.
  • Add regression tests asserting that bucket listing/creation errors include the service error code in the resulting Error::Network message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overtrue overtrue force-pushed the codex/fix-issue-210-service-error branch from 3858156 to 512086a Compare May 22, 2026 13:08
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.

rc mb Network error: service error

2 participants