fix: Catch 404s for non-existing hooks. Fixes #176

Explanation: Repositories where no webhooks are defined return 404 errors. This breaks further script execution.
This commit is contained in:
Moritz Federspiel
2024-01-16 15:13:26 +01:00
parent a97f15b519
commit 42b836f623

View File

@@ -1189,8 +1189,11 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
template = "{0}/{1}/hooks".format(repos_template, repository["full_name"])
try:
_backup_data(args, "hooks", template, output_file, hook_cwd)
except SystemExit:
logger.info("Unable to read hooks, skipping")
except Exception as e:
if "404" in str(e):
logger.info("Unable to read hooks, skipping")
else:
raise e
def backup_releases(args, repo_cwd, repository, repos_template, include_assets=False):