Repository navigation
fix(fhirpath): relay only OperationOutcome text from a failed terminology call - #2960
Open
angela-helios wants to merge 1 commit into
Open
angela-helios wants to merge 1 commit into
angela-helios wants to merge 1 commit into
Conversation
…logy call A non-2xx terminology answer put its whole body into the error that reaches fhirpath-server, HFS and sof-server callers, so HTML pages, proxy messages and stack traces were relayed at any size. The error now carries the status and, for an OperationOutcome body, its issue diagnostics cut to 500 characters; any other body only goes to the debug log. Closes #2959
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Closes #2959
Summary
A non-2xx terminology answer put its whole body into
FhirPathError::TerminologyHttpError, which reaches fhirpath-server, HFS and sof-server callers. HTML error pages, proxy messages and stack traces were relayed as is, at any size.read_responsenow builds the message from the status, plus, when the body is an OperationOutcome, thediagnostics(elsedetails.text) of its issues, joined and cut to 500 characters. That keeps useful answers such as "ValueSet … not found". Any other body is not relayed: it goes to the debug log, cut to 2048 characters.Tests
New:
terminology_client::tests::an_error_relays_only_operation_outcome_text_cut_short, against a mock server answering 404:With the raw body relayed again, the HTML case fails: the message carries
internal-host.corp: stack trace….Changed:
terminology_cloudflare_retry_limit_preserves_final_errorandterminology_retry_limit_preserves_final_errorasserted that the upstream body (the Cloudflare page,gateway unavailable) reached the message. They still check that the final status survives the retries, and now check that those bodies do not reach the message.cargo test -p helios-fhirpath --lib terminology: 60 passed. Clippy onhelios-fhirpath --all-targetsis clean. No test in another crate depends on the old message.