httpbuilder
httpbuilder copied to clipboard
AsyncHTTPBuilder correct way of catching exceptions / handling 4xx or 5xx responses
I'm testing AsyncHTTPBuilder doing POST of requests with XML body.
When the server responds with 400, I get an exception on the client side, but instead of getting groovyx.net.http.HttpResponseException, I'm getting java.util.concurrent.ExecutionException (this wraps the HttpResponseException).
- Should I except all exceptions from the connection to be wrapped into ExecutionException?
- Is there a way to specify failure handler for AsyncHTTPBuilder?