def _is_project_deleted_error(err):
    """Checks if the error is due to the project having been deleted.

    Args:
        err (HttpError): The error message returned by the API call.

    Returns:
        bool: True if the project was deleted, else False.
    """
    error_msg = str(
        err)  # HttpError Class decodes json encoded error into str
    if ((err.resp.status in (400, 404) and
         ('Invalid value for project' in error_msg or
          # Error string changed.
          'Failed to find project' in error_msg)) or
            (err.resp.status == 403 and
             'scheduled for deletion' in error_msg)):
        return True
    return False