public interface

ResponseErrorHandler

org.springframework.web.client.ResponseErrorHandler
Known Indirect Subclasses

Class Overview

Strategy interface used by the RestTemplate to determine whether a particular response has an error or not.

Summary

Public Methods
abstract void handleError(ClientHttpResponse response)
Handles the error in the given response.
abstract boolean hasError(ClientHttpResponse response)
Indicates whether the given response has any errors.

Public Methods

public abstract void handleError (ClientHttpResponse response)

Handles the error in the given response. This method is only called when hasError(ClientHttpResponse) has returned true.

Parameters
response the response with the error
Throws
IOException in case of I/O errors

public abstract boolean hasError (ClientHttpResponse response)

Indicates whether the given response has any errors. Implementations will typically inspect the HttpStatus of the response.

Parameters
response the response to inspect
Returns
  • true if the response has an error; false otherwise
Throws
IOException in case of I/O errors