hi @oseymen,
I tried to handle 3 types of error, which are validated upfront upon user request payload, validated upon the backend payload response and apigee internal server (policy) error. However i’m not able to reach the condition whereby the error suppose to go into defaultfaultrule expression as below:
eg : invalid access token error
default-policies.jpg
trace-session.jpg
eg of raise fault policy
raisefault-rf-errorresponse.jpg
eg of java script
java-script-js-setapigeeerror.jpg
Perhaps you can assist me to ease my troubleshooting on this.
Thanks.
Hi @Muhammad Hafiz
Couple of points:
- If you want your DefaultFaultRule to always execute (even if a FaultRule was executed), you need to set to true. More info on this here: http://docs.apigee.com/api-services/content/fault-handling#execution
- If you put a RaiseFault policy within a FaultRule, that will prevent DefaultFaultRule to be executed - even if is set to true.
So I’d recommend you only put a RaiseFault policy under DefaultFaultRule, set to true and use AssignMessage policies within FaultRules.
Check this post out for more information: https://community.apigee.com/content/kbentry/23724/an-error-handling-pattern-for-apigee-proxies.html