Permalink
Browse files

Do not interfere with HTTP 400 if it does not have an ErrorResponse

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information...
1 parent 43b215d commit fba0a2958d8d81043e91dcdf3e022953745e9c33 @adreghiciu adreghiciu committed with cstamas Nov 14, 2012
@@ -586,18 +586,17 @@ T perform()
{
if ( response.hasEntity() )
{
+ final ErrorResponse errorResponse;
try
{
- throw new BadRequestException( response.getEntity( ErrorResponse.class ) );
+ errorResponse = response.getEntity( ErrorResponse.class );
}
- catch ( ClientHandlerException ignore )
+ catch ( final Exception ignore )
{
- // ignore as we do have an error response
- }
- catch ( UniformInterfaceException ignore )
- {
- // ignore as we do have an error response
+ // we can't convert, so let it flow
+ throw e;
}
+ throw new BadRequestException( errorResponse );
}
}
else if ( response.getStatus() == ClientResponse.Status.NOT_FOUND.getStatusCode() )

0 comments on commit fba0a29

Please sign in to comment.