fix(runtime): preserve structured operation and reason in OperationFailedError#440
Closed
hiro-nikaitou wants to merge 1 commit into
Closed
Conversation
…iledError OperationFailedError was hardcoding details: '' and omitting meta, so the serialized error on a failed dispatched operation contained no structured data — downstream error trackers had to regex-parse the prose message to recover the operation name and underlying reason. Fix: pass reason as details and carry both operation and reason as structured meta, matching the pattern used by other FlueError subclasses throughout the codebase. Closes withastro#431 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for the contribution! We're closing this PR and moving the conversation to the issue: #441 We've moved to a model where bugs and feature proposals are discussed in issues/discussions before code review, so the community can help prioritize and shape the work. Your branch is linked from the new thread so the implementation isn't lost — please join us there to continue the conversation. — astrobot 🤖 |
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.
Problem
OperationFailedErrorhardcodesdetails: ''and omitsmeta, so the serialized error on a failed dispatched operation contains no structured data. Downstream error trackers must regex-parse the prose message to recover the operation name and underlying reason, which breaks issue grouping (the embedded dispatch UUID makes every occurrence a unique message) and prevents programmatic classification.Closes #431.
Changes
packages/runtime/src/errors.ts— two changes inOperationFailedError:detailsis now populated withreasoninstead of'', so callers receive the underlying failure text as structured detail rather than having to extract it from the prose message.metanow carries{ operation, reason }, matching the pattern used by otherFlueErrorsubclasses (e.g.CloudflareAIBindingError,AttachmentLoadingError).Verification
Tested on Windows 11 (Git Bash / pnpm 11.1.1):
pnpm test --filter=@flue/runtime: 47/48 test files passed, 771/784 tests passed.node-local-sandbox.test.ts) is a pre-existing Windows-specificEBUSY: resource busy or lockedcleanup issue — unrelated to this change.