code: def _set_error_response_with_body(self, bucket_name=None):
          
          if len(self._response.data) == 0:
              raise ValueError('response data has no body.')
          try:
              root = cElementTree.fromstring(self._response.data)
          except _ETREE_EXCEPTIONS as error:
              raise InvalidXMLError('"Error" XML is not parsable. '
                                    'Message: {0}'.format(error.message))
          for attribute in root:
              if attribute.tag == 'Code':
                  self.code = attribute.text
              elif attribute.tag == 'BucketName':
                  self.bucket_name = attribute.text
              elif attribute.tag == 'Key':
                  self.object_name = attribute.text
              elif attribute.tag == 'Message':
                  self.message = attribute.text
              elif attribute.tag == 'RequestId':
                  self.request_id = attribute.text
              elif attribute.tag == 'HostId':
                  self.host_id = attribute.text
          # Set amz headers.
          self._set_amz_headers()
docs: Sets all the error response fields with a valid response body.
             Raises :exc:`ValueError` if invoked on a zero length body.
  
          :param bucket_name: Optional bucket name resource at which error
             occurred.
          :param object_name: Option object name resource at which error
             occurred.