Apigee Internal server - error handling

Not applicable

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.

0 1 490
1 REPLY 1

Hi @Muhammad Hafiz

Couple of points:

  1. If you want your DefaultFaultRule to always execute (even if a FaultRule was executed), you need to set <AlwaysEnforce> to true. More info on this here: http://docs.apigee.com/api-services/content/fault-handling#execution
  2. If you put a RaiseFault policy within a FaultRule, that will prevent DefaultFaultRule to be executed - even if <AlwaysEnforce> is set to true.

So I'd recommend you only put a RaiseFault policy under DefaultFaultRule, set <AlwaysEnforce> 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