Repository navigation
fix: keep retryable and 5xx status when sanitizing internal errors - #893
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
toExternal() changed every internal error to a non-retryable 500. A retryable internal 503 (for example a dropped database connection) reached API callers as a 500 that they must not retry. The sanitized error now keeps `retryable` and a 5xx status. It still hides the code, message, context, hint and source. A non-5xx status becomes 500, because a 4xx would blame the caller for a server fault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: a9e4e380-d99f-4011-bb75-d4e5ae320c26
|
Enclave skipped this draft pull request. It will run automatically when you mark the PR as Ready for review. |
This branch has not been deployed
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
AlienError.toExternal(). That function changes every internal error toGENERIC_ERROR,retryable: false, status 500.Origin
Changes
retryableand its 5xx status. The code, message, context, hint and source stay hidden.AlienError.from(Response)) must not blame the caller.Note
The external response now shows whether an internal fault is retryable and which 5xx class it has. It shows no message or context.
Testing
pnpm testinpackages/core: 101 passed.pnpm test:tsandpnpm format-and-lintpass. The one Biome warning was there before this change.Agent context
AlienError::into_external(crates/alien-error) has the same behavior. I did not change it here: no Rust HTTP server callsinto_external_response, and the CLI and worker runtime useinto_externalonly for display. It can follow in a separate PR for parity.@alienplatform/core.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code