diff --git a/awscli/botocore/handlers.py b/awscli/botocore/handlers.py index 2274da56ddcf..8ba860957312 100644 --- a/awscli/botocore/handlers.py +++ b/awscli/botocore/handlers.py @@ -114,37 +114,6 @@ def escape_xml_payload(params, **kwargs): params['body'] = body -def check_for_200_error(response, **kwargs): - """This function has been deprecated, but is kept for backwards compatibility.""" - # From: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html - # There are two opportunities for a copy request to return an error. One - # can occur when Amazon S3 receives the copy request and the other can - # occur while Amazon S3 is copying the files. If the error occurs before - # the copy operation starts, you receive a standard Amazon S3 error. If the - # error occurs during the copy operation, the error response is embedded in - # the 200 OK response. This means that a 200 OK response can contain either - # a success or an error. Make sure to design your application to parse the - # contents of the response and handle it appropriately. - # - # So this handler checks for this case. Even though the server sends a - # 200 response, conceptually this should be handled exactly like a - # 500 response (with respect to raising exceptions, retries, etc.) - # We're connected *before* all the other retry logic handlers, so as long - # as we switch the error code to 500, we'll retry the error as expected. - if response is None: - # A None response can happen if an exception is raised while - # trying to retrieve the response. See Endpoint._get_response(). - return - http_response, parsed = response - if _looks_like_special_case_error( - http_response.status_code, http_response.content - ): - logger.debug("Error found for response with 200 status code, " - "errors: %s, changing status code to " - "500.", parsed) - http_response.status_code = 500 - - def _looks_like_special_case_error(status_code, body): if status_code == 200 and body: try: