title: How to parse Boto3 200 response for copy_object request
body: <p>I am new to Python and I'm writing an AWS lambda that copies files from one bucket to another. I am using the Boto3 library and have come across the following in the documentation:</p>
  <blockquote>
  <p>A copy request might return an error when Amazon S3 receives the copy request or 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. Design your application to parse the contents of the response and handle it appropriately.
  If the copy is successful, you receive a response with information about the copied object.</p>
  </blockquote>
  <p>A successful response looks like this (potential sensitive data replaced with '...') :</p>
  <pre><code>Response : {'ResponseMetadata': {'RequestId': 'ID....', 'HostId': 'ID...', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-id-2': '...', 'x-amz-request-id': '...', 'date': 'Wed,
              10 Feb 2021 21: 48: 48 GMT', 'content-type': 'application/xml', 'content-length': '234', 'server': 'AmazonS3'
          }, 'RetryAttempts': 0
      }, 'CopyObjectResult': {'ETag': '&quot;...&quot;', 'LastModified': datetime.datetime(2021,
          2,
          10,
          21,
          48,
          48, tzinfo=tzlocal())
      }
  }
  </code></pre>
  <p>I want to know how I would parse the 200 response to check for errors. The documentation says that if the copy is successful then you will receive a response with information about the copied object. I am guessing that this is the CopyObjectResult section?</p>
  <p>I am accessing the response as so:</p>
  <pre><code>   response = s3_client.copy_object(CopySource=copy_source_object, Bucket=destination_bucket_name, Key=destination_key_prefix+file_key_name)
  </code></pre>
  <p>I now want to write a statement that says if the object was copied successfully, then delete the object from the source bucket. I will need to check that not only is the response a 200 response but that it also contains no embedded errors. I can't find an example 200 response that includes an error to be sure that I have written it correctly so I am turning to the trusty SO community for help.</p>
  <p>Thanks in advance.</p>