Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct exception handling #1348

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion conda_forge_admin_requests/feedstock_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
import github


def _test_and_raise_besides_file_not_exists(e: github.GithubException):
if isinstance(e, github.UnknownObjectException):
return
if e.status == 404 and "No object found" in e.data["message"]:
return
raise e


def _add_feedstock_output(
feedstock,
pkg_name,
Expand All @@ -17,7 +25,8 @@ def _add_feedstock_output(
repo = gh.get_repo("conda-forge/feedstock-outputs")
try:
contents = repo.get_contents(_get_sharded_path(pkg_name))
except github.UnknownObjectException:
except github.GithubException as e:
_test_and_raise_besides_file_not_exists(e)
contents = None

if contents is None:
Expand Down
Loading