Kirill Bondar 10/8/2019 8:30:55 AM
Before we introduced Stop/Continue Execution switch we stopped on erroneous third-party server response unconditionally and displayed generic error message. We evaluated Error Formula only on successful results. If formula produces NULL, execution continued, non-NULL result is used as an error message. Checking Stop Execution follows this logic exactly.
Now, if Continue Execution is checked both successful and erroneous results are passed to Error Formula for evaluation. There, in addition to examining the response you can use ResponseStatus() function to quickly check whether the call was successful or not. In general ResponseStatus() >= 400 indicates error ( https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_errors
For example, the formula below can be used to extract error message from failed TeamDesk REST API call:
If(ResponseStatus()>=400, "TeamDesk REST API responded with: " & Response("$.message"), null)