Skip to content

Commit

Permalink
Catch HacsException in common_update (#2446)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Jan 16, 2022
1 parent 121f716 commit 48039bf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/hacs/repositories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ async def common_update(self, ignore_issues=False, force=False) -> bool:
self.data.full_name = self.hacs.common.renamed_repositories[self.data.full_name]
await self.common_update_data(ignore_issues=ignore_issues, force=force)

except HacsException:
if not ignore_issues and not force:
return False

if not self.data.installed and (current_etag == self.data.etag_repository) and not force:
self.logger.debug("Did not update %s, content was not modified", self.data.full_name)
return False
Expand Down Expand Up @@ -943,12 +947,12 @@ async def common_update_data(self, ignore_issues: bool = False, force: bool = Fa
self.validate.errors.append("Repository is archived.")
if self.data.full_name not in self.hacs.common.archived_repositories:
self.hacs.common.archived_repositories.append(self.data.full_name)
raise HacsRepositoryArchivedException("Repository is archived.")
raise HacsRepositoryArchivedException(f"{self} Repository is archived.")

# Make sure the repository is not in the blacklist.
if self.hacs.repositories.is_removed(self.data.full_name) and not ignore_issues:
self.validate.errors.append("Repository is in the blacklist.")
raise HacsException("Repository is in the blacklist.")
self.validate.errors.append("Repository has been requested to be removed.")
raise HacsException(f"{self} Repository has been requested to be removed.")

# Get releases.
try:
Expand Down

0 comments on commit 48039bf

Please sign in to comment.