Skip to content

fix: preserve NonRetryableError message when compat flag is enabled#13560

Merged
petebacondarwin merged 8 commits intocloudflare:mainfrom
vaishnav-mk:vaish/fix-nonretryable-error-message
Apr 22, 2026
Merged

fix: preserve NonRetryableError message when compat flag is enabled#13560
petebacondarwin merged 8 commits intocloudflare:mainfrom
vaishnav-mk:vaish/fix-nonretryable-error-message

Conversation

@vaishnav-mk
Copy link
Copy Markdown
Contributor

@vaishnav-mk vaishnav-mk commented Apr 16, 2026

Fixes the NonRetryableError message being replaced with a generic error message in local dev

When the workflows_preserve_non_retryable_error_message compatibility flag is enabled, NonRetryableError now preserves the original error name and message instead of replacing it with a generic WorkflowFatalError message


  • Tests
  • Tests included/updated
  • Automated tests not possible - manual testing has been completed as follows:
    • Tested locally with wrangler dev using local build with the compat flag enabled, error shows preserved NonRetryableError name and original message
    • Tested locally with wrangler dev using local build without the compat flag, error shows generic WorkflowFatalError message (unchanged behavior)
  • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is behind an experimental compatibility flag (workflows_preserve_non_retryable_error_message). Docs will be added when it graduates to a compat date.

A picture of a cute animal (not mandatory, but encouraged)
image

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

🦋 Changeset detected

Latest commit: abc0451

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vaishnav-mk vaishnav-mk marked this pull request as ready for review April 16, 2026 09:39
@workers-devprod workers-devprod requested review from a team and penalosa and removed request for a team April 16, 2026 09:39
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 16, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Comment thread packages/workflows-shared/src/engine.ts Outdated
Comment thread packages/workflows-shared/src/engine.ts Outdated
@vaishnav-mk vaishnav-mk force-pushed the vaish/fix-nonretryable-error-message branch from cb2fa30 to 8b56879 Compare April 17, 2026 08:17
devin-ai-integration[bot]

This comment was marked as resolved.

@vaishnav-mk vaishnav-mk force-pushed the vaish/fix-nonretryable-error-message branch from 8b56879 to 396be46 Compare April 17, 2026 08:32
devin-ai-integration[bot]

This comment was marked as resolved.

@vaishnav-mk vaishnav-mk force-pushed the vaish/fix-nonretryable-error-message branch 2 times, most recently from 71252fa to 0cbbdff Compare April 17, 2026 09:06
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Looking much cleaner. It's a shame that one must pass through the compat flags but I can't think of a more straightforward approach.

Comment thread packages/workflows-shared/tests/engine.test.ts Outdated
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13560

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13560

miniflare

npm i https://pkg.pr.new/miniflare@13560

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13560

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13560

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13560

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13560

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13560

wrangler

npm i https://pkg.pr.new/wrangler@13560

commit: abc0451

@penalosa penalosa removed their request for review April 17, 2026 10:43
@vaishnav-mk vaishnav-mk force-pushed the vaish/fix-nonretryable-error-message branch from 0cbbdff to 965ee4f Compare April 21, 2026 05:38
devin-ai-integration[bot]

This comment was marked as resolved.

Comment thread packages/miniflare/src/plugins/workflows/index.ts
@pombosilva pombosilva self-requested a review April 21, 2026 07:43
Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Apr 21, 2026
@petebacondarwin
Copy link
Copy Markdown
Contributor

miniflare:build: ../workflows-shared/src/lib/errors.ts(110,61): error TS2339: Property 'compatibilityFlags' does not exist on type '{}'.

@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@vaishnav-mk
Copy link
Copy Markdown
Contributor Author

miniflare:build: ../workflows-shared/src/lib/errors.ts(110,61): error TS2339: Property 'compatibilityFlags' does not exist on type '{}'.

i switched to any for globalThis

@petebacondarwin petebacondarwin merged commit 7567ef7 into cloudflare:main Apr 22, 2026
61 of 62 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants