httpbuilder icon indicating copy to clipboard operation
httpbuilder copied to clipboard

AsyncHTTPBuilder correct way of catching exceptions / handling 4xx or 5xx responses

Open ppazos opened this issue 7 years ago • 0 comments

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).

  1. Should I except all exceptions from the connection to be wrapped into ExecutionException?
  2. Is there a way to specify failure handler for AsyncHTTPBuilder?

ppazos avatar Oct 12 '17 20:10 ppazos