I try some case:
- if my http response is 200 then OK, go to next step of chain
- if my http response i 504 repeat http request until response is not 504
- If my http response is not 200 and is not 504 then “exitHereIfFailed”
What is the best solution of my case. I have only one idea - something like following (pseudo-code):
def myRequest:ChainBuilder = … .check(status.in(200, 504), status.saveAs(“statusCode”)).exitHereIfFailed
myRequest.asLongAs(session => session(“statusCode”) != 200) { myRequest }
But this is very ugly solution. Any better idea?