I am using spring RestTemplate to consume rest services(exposed in spring rest). I am able to consume success scenarios. But for negative scenarios, service returns
RestTemplate
You might want to distinguish between:
HttpClientErrorException (HTTP-Status >=400) or HttpServerErrorException (HTTP-Status >= 500) or even RestClientException.
HttpClientErrorException
HttpServerErrorException
RestClientException
Further on there is a good doc about defining your own ErrorHandler, see this link