Code example for DefaultResponseErrorHandler

import java.util.Map;
 * @author Umut Utkan 
public class SalesforceErrorHandler extends DefaultResponseErrorHandler {
    public void handleError(ClientHttpResponse response) throws IOException {
        Map<String, Object> errorDetails = extractErrorDetailsFromResponse(response);
        if (errorDetails == null) {
            handleUncategorizedError(response, errorDetails);
        handleSalesforceError(response.getStatusCode(), errorDetails);
        // if not otherwise handled, do default handling and wrap with UncategorizedApiException 
        handleUncategorizedError(response, errorDetails);
Experience pair programming with AI  Get Codota for Java