-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
Description
Bug
Different error types place the error message in different fields, making programmatic error handling unreliable:
- Some errors use
issue[].details.text - Others use
issue[].diagnostics
Repro
# 400 — message in details.text
curl -s 'https://tx-dev.fhir.org/r4/CodeSystem/$lookup?code=male' \
-H 'Accept: application/fhir+json' | jq '{details_text: .issue[0].details.text, diagnostics: .issue[0].diagnostics}'
# Returns: {"details_text": "Must provide system and code, or a coding", "diagnostics": null}
# 422 — message in diagnostics
curl -s 'https://tx-dev.fhir.org/r4/CodeSystem/$lookup?system=http://example.org/fake&code=x' \
-H 'Accept: application/fhir+json' | jq '{details_text: .issue[0].details?.text, diagnostics: .issue[0].diagnostics}'
# Returns: {"details_text": null, "diagnostics": "Code System http://example.org/fake not found"}Reactions are currently unavailable