Hi Frostiy ,
You can use ${audit.details.last.fullText} to get the last error message.
Here is an example -> copy the xml below and paste to an empty policy on policy manger- > send your sample payload -> it will return,
err: Source is not a valid JSON.
<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<wsp:OneOrMore wsp:Usage="Required">
<wsp:All wsp:Usage="Required">
<L7p:EvaluateJsonPathExpression>
<L7p:Expression stringValue="test"/>
</L7p:EvaluateJsonPathExpression>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="cmVzdWx0Ogoke2pzb25QYXRoLnJlc3VsdH0="/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
<wsp:All wsp:Usage="Required">
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="ZXJyOiAke2F1ZGl0LmRldGFpbHMubGFzdC5mdWxsVGV4dH0="/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
<L7p:ResponseStatus stringValue="601"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:OneOrMore>
</wsp:All>
</wsp:Policy>
Regards,
Mark