Skip to content

Commit 42b836f

Browse files
committed
fix: Catch 404s for non-existing hooks. Fixes #176
Explanation: Repositories where no webhooks are defined return 404 errors. This breaks further script execution.
1 parent a97f15b commit 42b836f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

github_backup/github_backup.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,11 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
11891189
template = "{0}/{1}/hooks".format(repos_template, repository["full_name"])
11901190
try:
11911191
_backup_data(args, "hooks", template, output_file, hook_cwd)
1192-
except SystemExit:
1193-
logger.info("Unable to read hooks, skipping")
1192+
except Exception as e:
1193+
if "404" in str(e):
1194+
logger.info("Unable to read hooks, skipping")
1195+
else:
1196+
raise e
11941197

11951198

11961199
def backup_releases(args, repo_cwd, repository, repos_template, include_assets=False):

0 commit comments

Comments
 (0)