Code example for DefaultResponseErrorHandler

0
import org.springframework.social.ServerOverloadedException; 
import org.springframework.social.UncategorizedApiException; 
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestClientException;
 
public class WeiboErrorHandler extends DefaultResponseErrorHandler {
 
	@Override 
	public void handleError(ClientHttpResponse response) throws IOException {
		HttpStatus statusCode = response.getStatusCode();
		if (statusCode.series() == Series.SERVER_ERROR) {
			handleServerErrors(statusCode);
		} else if (statusCode.series() == Series.CLIENT_ERROR) {
			handleClientErrors(response);
		} 
 
		// if not otherwise handled, do default handling and wrap with 
		// UncategorizedApiException 
		try { 
			super.handleError(response);
Contextual code suggestions in your IDE  Get Codota for Java