{response.content.message||error.content.fault.faultstring||flow.apiproxy.error.reason}

I'm trying to configure a FAULT in my API which is based on XML.

<RaiseFault async="false" continueOnError="false" enabled="true" name="RF.raise-fault"> <FaultResponse>

and I want to set a NON-NULL value for

<ServerErrorMessage>{response.content.message}{error.content.fault.faultstring}{flow.apiproxy.error.reason}</ServerErrorMessage>

Like, Only one out of all 3 will get value and other 2 are just null/blank.

Everything is working fine except this one. Not sure whether we have conditional based configuration available in FAULT.

{"fault":{"faultstring":"Invalid Access Token","detail":{"errorcode":"keymanagement.service.invalid_access_token"}}}

Above is my response under "Error Content" and I would like to capture the FAULTSTRING and display under ServerErrorMessage tag. However it is not working out I tried multiple options but taht doesnt seem to be working.

Is there any other way to deal with this. (If i get multiple error codes, teh message will be stored in different tags and i would need to read them under a common tag.

Can someone pls help me out here with some options.

1 1 114
1 REPLY 1

This won't help you now, but we are expecting to add a new fucntion to the message template that returns the first non-null value. With this feature in the future you will be able to do this:

{firstnonnull(response.content.message,error.content.fault.faultstring,flow.apiproxy.error.reason,'default message')}

but this isn't released yet.

b/139698514