Grailsrocks/grails-functional-test — pull request #9 by michaelcameron (2012-07-12 18:52:11+00:00)
Title: Preserve response data on error. RESTClient still has response data for HTTP >= 400 status

There's still data in HTTP responses >= 400. RESTClient will preserve that data and then throw the exception. I know this is duplicate code for the try, so ripe for refactoring. I tried playing around with failure handlers. I want to do what RESTClient.defaultFailureHandler() without throwing the exception, but it relies on HTTPBuilder.defaultSuccessHandler() which is protected and non-trivial. The only clean way I can think of would be to subclass RESTClient and override defaultFailureHandler, then having access to HTTPBuilder.defaultSuccessHandler(). I know you have the TODO in there to change/remove the failure handler. If you want to go down that route. I could make the changes and submit a pull request.