mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
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:
@@ -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:
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user