grails-plugins / grails-rest-client-builder

REST client plugin that uses Spring's RestTemplate
http://grails.org/plugin/rest-client-builder
Apache License 2.0
65 stars 32 forks source link

RestBuilder#doRequestInternal partially handles exceptions #4

Closed noamt closed 11 years ago

noamt commented 12 years ago

RestBuilder#doRequestInternal invokes RestTemplate#exchange and wraps it with a try-catch block that handles exceptions of type org.springframework.web.client.HttpClientErrorException.

exchange may also throw exceptions of type org.springframework.web.client.HttpServerErrorException; the server exceptions are uncaught and are propagated to the plugin user.

This creates an inconsistency in the response because the client exceptions are returned wrapped by ErrorResponse.