Skip to content

✨ Treat upstream HTTP and fetch failures as transient, match bare D1 internal error - #7

Merged
dryan merged 1 commit into
mainfrom
feat/transient-origin-errors
Oct 26, 2026
Merged

dryan merged 1 commit into
mainfrom
feat/transient-origin-errors

Conversation

@dryan-gh-actions

@dryan-gh-actions dryan-gh-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

  • src/d1.ts: isTransientD1Error also matches the bare internal error (with or without the D1_ERROR: prefix) via an anchored pattern. A message that merely contains the words is not matched.
  • New src/origin.ts: isTransientOriginStatus (408, 425, 429, 500 to 530) and isTransientOriginError (transient status/statusCode, fetch network failures, TimeoutError/AbortError; walks cause and AggregateError). Exported from the index.
  • src/sentry.ts: groupCloudflareErrors fingerprints origin errors as cloudflare-transient.
  • Tests and README updated.

Why

Origin 5xx/429, fetch failures, timeouts and D1's bare "internal error" each opened their own issues instead of grouping as transient.

Serves:

npm test (tsc + vitest): 76 passed.

🤖 Generated with Claude Code

…internal error

Workers kept opening issues for origin 5xx/429, fetch network failures,
timeouts and D1's bare "internal error" (no reference). Add
isTransientOriginStatus/isTransientOriginError, match the bare D1 message with
an anchored pattern, and fingerprint origin errors as cloudflare-transient.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
@dryan-gh-actions
dryan-gh-actions Bot requested a review from a team as a code owner October 26, 2026 14:11
@dryan
dryan merged commit 379be41 into main Oct 26, 2026
3 checks passed
@dryan
dryan deleted the feat/transient-origin-errors branch October 26, 2026 14:13
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