Skip to content

OperationOutcome error message placement inconsistent ( vs ) #106

@jmandel

Description

@jmandel

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"}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions