Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How custom exception for FHIR #681

Open
ander-chan opened this issue Apr 28, 2022 · 0 comments
Open

How custom exception for FHIR #681

ander-chan opened this issue Apr 28, 2022 · 0 comments

Comments

@ander-chan
Copy link

Regards!. In the FHIR is a standard the output is represented by "OperationOutcome's" and the errors, the same eg:.

{
	"resourceType": "OperationOutcome",
	"meta": {
		"profile": ["https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-OperationOutcome-1"]
	},
	"issue": [{
		"severity": "error",
		"code": "not-found",
		"details": {
			"coding": [{
				"system": "https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1",
				"code": "PATIENT_NOT_FOUND",
				"display": "Patient not found"
			}]
		}
	}]
}
<?xml version="1.0" encoding="UTF-8"?><OperationOutcome xmlns="http://hl7.org/fhir">
  <id value="searchfail"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>The &quot;name&quot; parameter has the modifier &quot;exact&quot; which is not supported by this server</p>
    </div>
  </text>
  <issue>
    <severity value="fatal"/>
    <code value="code-invalid"/>
    <details>
      <text value="The &quot;name&quot; parameter has the modifier &quot;exact&quot; which is not supported by this server"/>    
    </details> 
    <location value="http.name:exact"/>    
  </issue>
</OperationOutcome>

I'm thinking extends RestExeption... How custom the actual output exception?

{
  "error": {
    "code": 400,
    "message": "Bad Request: `login` is required."
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant