code: def _set_error_response_without_body(self, bucket_name=None):
          
          if self._response.status == 404:
              if bucket_name:
                  if self.object_name:
                      self.code = 'NoSuchKey'
                      self.message = self._response.reason
                  else:
                      self.code = 'NoSuchBucket'
                      self.message = self._response.reason
          elif self._response.status == 409:
              self.code = 'Conflict'
              self.message = 'The bucket you tried to delete is not empty.'
          elif self._response.status == 403:
              self.code = 'AccessDenied'
              self.message = self._response.reason
          elif self._response.status == 400:
              self.code = 'BadRequest'
              self.message = self._response.reason
          elif self._response.status == 301:
              self.code = 'PermanentRedirect'
              self.message = self._response.reason
          elif self._response.status == 307:
              self.code = 'Redirect'
              self.message = self._response.reason
          elif self._response.status in [405, 501]:
              self.code = 'MethodNotAllowed'
              self.message = self._response.reason
          elif self._response.status == 500:
              self.code = 'InternalError'
              self.message = 'Internal Server Error.'
          else:
              self.code = 'UnknownException'
              self.message = self._response.reason
          # Set amz headers.
          self._set_amz_headers()
docs: Sets all the error response fields from response headers.