Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Do not interfere with HTTP 400 if it does not have an ErrorResponse
Browse files Browse the repository at this point in the history
Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information
adreghiciu authored and cstamas committed Nov 21, 2012
1 parent 43b215d commit fba0a29
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,18 +586,17 @@ private <T> T handle( final Operation<T> callable )
{
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() )
Expand Down

0 comments on commit fba0a29

Please sign in to comment.