Repository navigation
DX-3114: keep the storage provider out of error messages - #9
Merged
CahidArda merged 1 commit intoOct 6, 2026
Merged
Conversation
The signature_mismatch hint, the rate_limited message and the request_failed message named R2, and e.message is meant to be shown to end users. Reword them to say "storage", and move storage's raw <Message> text onto e.cause so it is still there for debugging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ucc4Vbj1ej2kaLWQth3CRw
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused wording changes preserve existing behavior and have appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Updates user-facing storage errors to avoid exposing R2 implementation details while preserving diagnostic information in cause.
Changes:
- Rewords signature, rate-limit, and request-failure messages.
- Moves raw storage failure text to
BlobError.cause. - Adds regression coverage for provider-neutral errors.
| File | Description |
|---|---|
src/shared/errors.ts |
Rewords the signature-mismatch hint. |
src/server/r2.ts |
Makes storage errors provider-neutral and preserves diagnostic details. |
test/unit/server.test.ts |
Verifies messages, hints, status mapping, and error causes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
up-ilter
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BlobErrormessages named R2 in three places.e.messageis meant to be shown to end users (the quickstart rendersupload.error.messagedirectly), so a customer's users saw "a 403 from R2 usually means…". This PR words those messages around "storage" instead.Linear: DX-3114
Changes
src/shared/errors.ts,signature_mismatchhinta 403 from R2 usually means the body length or type differs from the signaturethe upload did not match what was authorized, usually a different size or content typesrc/server/r2.ts,rate_limitedR2 rate limited the requeststorage rate limited the requestsrc/server/r2.ts,request_failedR2 responded <status> <Code>: <Message>storage responded <status> <Code>Storage's raw
<Message>text no longer goes intoe.message, since R2 can name itself there. It is set one.causeinstead, so it is still available for debugging.Codes, statuses and the 403 →
signature_mismatchmapping are unchanged. Only the wording differs.Tests
test/unit/server.test.ts: a 403, a 429 and a 400 from storage. It asserts that neithermessagenorhintmentions R2 or Cloudflare, and that storage's text lands one.cause. It fails without the fix.bun test test/unit: 352 pass.pnpm typecheckandpnpm lintare clean.Docs
Matching docs change: upstash/docs#896
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ucc4Vbj1ej2kaLWQth3CRw