Skip to content

Commit e1b5f75

Browse files
committed
Use DefaultFaultRule to handle mime type
1 parent 627cb15 commit e1b5f75

File tree

3 files changed

+10
-63
lines changed

3 files changed

+10
-63
lines changed

proxies/live/apiproxy/policies/RaiseFault.500InternalServerError.xml

Lines changed: 0 additions & 45 deletions
This file was deleted.

proxies/live/apiproxy/policies/RaiseFault.400BadRequest.xml renamed to proxies/live/apiproxy/policies/RaiseFault.DefaultError.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<!--
3-
This policy raises a 400 error response for an application failure.
3+
This policy raises when an error occurs in the AWS Application.
44
55
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.
66
77
For more information on RaiseFault policies within Apigee see the following resource:
88
* https://docs.apigee.com/api-platform/reference/policies/raise-fault-policy
99
-->
10-
<RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault.400BadRequest">
11-
<DisplayName>RaiseFault.400BadRequest</DisplayName>
10+
<RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault.DefaultError">
11+
<DisplayName>RaiseFault.DefaultError</DisplayName>
1212
<Properties/>
1313
<FaultResponse>
1414
<Set>
1515
<Headers>
1616
<Header name="Content-Type">application/fhir+json</Header>
1717
</Headers>
18-
<StatusCode>400</StatusCode>
19-
<ReasonPhrase>BadRequest</ReasonPhrase>
2018
</Set>
2119
</FaultResponse>
2220
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>

proxies/live/apiproxy/targets/target.xml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@
2727
</Response>
2828
</PostFlow>
2929
<FaultRules>
30-
<FaultRule name="400_Bad_Request">
31-
<Step>
32-
<Name>RaiseFault.400BadRequest</Name>
33-
</Step>
34-
<Condition>response.status.code = 400</Condition>
35-
</FaultRule>
36-
<FaultRule name="Unauthorized">
30+
<FaultRule name="401_Unauthorized">
3731
<Step>
3832
<Name>RaiseFault.401Unauthorized</Name>
3933
</Step>
@@ -45,13 +39,13 @@
4539
</Step>
4640
<Condition>response.header.x-amzn-ErrorType = "IncompleteSignatureException"</Condition>
4741
</FaultRule>
48-
<FaultRule name="500_Internal_Server_Error">
49-
<Step>
50-
<Name>RaiseFault.500InternalServerError</Name>
51-
</Step>
52-
<Condition>response.status.code = 500</Condition>
53-
</FaultRule>
5442
</FaultRules>
43+
<DefaultFaultRule name="DefaultFaultRule">
44+
<Step>
45+
<Name>RaiseFault.DefaultError</Name>
46+
</Step>
47+
<AlwaysEnforce>true</AlwaysEnforce>
48+
</DefaultFaultRule>
5549
<HTTPTargetConnection>
5650
<LoadBalancer>
5751
<Server name="validated-relationships-service-api"/>

0 commit comments

Comments
 (0)