Skip to content

Commit

Permalink
fix: correct exception (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Jan 26, 2025
1 parent f03834c commit e4f5d51
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit e4f5d51

Please sign in to comment.