Skip to content

Commit

Permalink
Add 404 not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPlowman committed Apr 19, 2024
1 parent d75af20 commit 994ab92
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
42 changes: 42 additions & 0 deletions proxies/live/apiproxy/policies/RaiseFault.404NotFound.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This policy raises a 404 error response for an invalid resource request.
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.404NotFound">
<DisplayName>RaiseFault.404NotFound</DisplayName>
<Properties/>
<FaultResponse>
<Set>
<Headers/>
<StatusCode>404</StatusCode>
<ReasonPhrase>NotFound</ReasonPhrase>
<Payload>
{
"issue": [
{
"code": "processing",
"details": {
"coding": [
{
"code": "INVALIDATED_RESOURCE",
"display": "Resource that has been marked as invalid was requested - invalid resources cannot be retrieved",
"system": "https://fhir.nhs.uk/R4/CodeSystem/ValidatedRelationships-ErrorOrWarningCode",
"version": "1"
}
]
},
"severity": "error"
}
],
"resourceType": "OperationOutcome"
}
</Payload>
</Set>
</FaultResponse>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>
4 changes: 4 additions & 0 deletions proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<Step>
<Name>SetMimeType</Name>
</Step>
<Step>
<Name>RaiseFault.404NotFound</Name>
<Condition>response.header.x-amzn-ErrorType = IncompleteSignatureException</Condition>
</Step>
</Response>
</PostFlow>
<FaultRules>
Expand Down

0 comments on commit 994ab92

Please sign in to comment.