def check_error_response(self, body, status):
    """Raise an exception if the response from the backend was an error.

    Args:
      body: A string containing the backend response body.
      status: A string containing the backend response status.

    Raises:
      BackendError if the response is an error.
    """
    status_code = int(status.split(' ', 1)[0])
    if status_code >= 300:
      raise errors.BackendError(body, status)
Raise an exception if the response from the backend was an error.

    Args:
      body: A string containing the backend response body.
      status: A string containing the backend response status.

    Raises:
      BackendError if the response is an error.