I am using a ServiceCallout policy.
When getting an error response from the called-out-service I want to return it to the client with a minor modification of the response fields.
What do I need to do to achieve that?
I’ve tried using FaultRule with AssignMessage but it looks like after the error response comes from the service I cant get its content in the Error Flow
If this is successful the jwtUserInfo response obect would get populated. If there’s an error, you would get a 500 Error saying Error in Service Callout. Now, say you want to handle this error and give a meaningful error back to the client. You can make use of fault rules in this case:
So here, we are checking for the status code of the jstUserInfo response object and raise a fault if its not a 200. The corresponding raise fault policy looks like this: