-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 500 Fault rule and update all errors to have correct mime type
- Loading branch information
1 parent
0cc5137
commit ff3a308
Showing
5 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
proxies/live/apiproxy/policies/RaiseFault.400BadRequest.xml
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
45 changes: 45 additions & 0 deletions
45
proxies/live/apiproxy/policies/RaiseFault.500InternalServerError.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<!-- | ||
This policy raises a 500 error response for an internal server error. | ||
Raisefault policies stop the execution of the current flow and move to the error flow, which returns the error response defined here to the requesting application. | ||
For more information on RaiseFault policies within Apigee see the following resource: | ||
* https://docs.apigee.com/api-platform/reference/policies/raise-fault-policy | ||
--> | ||
<RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault.500InternalServerError"> | ||
<DisplayName>RaiseFault.500InternalServerError</DisplayName> | ||
<Properties/> | ||
<FaultResponse> | ||
<Set> | ||
<Headers> | ||
<Header name="Content-Type">application/fhir+json</Header> | ||
</Headers> | ||
<StatusCode>500</StatusCode> | ||
<ReasonPhrase>InternalServerError</ReasonPhrase> | ||
<Payload> | ||
{ | ||
"issue": [ | ||
{ | ||
"code": "invalid", | ||
"details": { | ||
"coding": [ | ||
{ | ||
"code": "SERVER_ERROR", | ||
"display": "Failed to generate response", | ||
"system": "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode", | ||
"version": "1" | ||
} | ||
] | ||
}, | ||
"diagnostics": "Internal Server Error - Failed to generate response", | ||
"severity": "error" | ||
} | ||
], | ||
"resourceType": "OperationOutcome" | ||
} | ||
</Payload> | ||
</Set> | ||
</FaultResponse> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</RaiseFault> |
This file contains 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