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

Silently ignored error #760

Closed
mfocko opened this issue Dec 15, 2022 · 1 comment · Fixed by #855
Closed

Silently ignored error #760

mfocko opened this issue Dec 15, 2022 · 1 comment · Fixed by #855
Assignees
Labels
area/github Related to GitHub implementation. 🌞 friday 🤟 Weekend is coming! good-first-issue Good for newcomers. kind/bug Something isn't working.

Comments

@mfocko
Copy link
Member

mfocko commented Dec 15, 2022

Discovered in: #759
Cause: An exception is raised when querying the users with permissions on a project, if the current user accessing the API doesn't have any permission themselves. However the current implementation checks generic GitHub exception which can lead to catching also other kind of errors, e.g. 50x

except github.GithubException:
logger.debug(
"Current Github token must have push access to view repository permissions."
)
return set()

@mfocko mfocko added kind/bug Something isn't working. good-first-issue Good for newcomers. area/github Related to GitHub implementation. 🌞 friday 🤟 Weekend is coming! labels Dec 15, 2022
@mfocko mfocko moved this to new in Packit Kanban Board Dec 15, 2022
@jpopelka jpopelka moved this from new to backlog in Packit Kanban Board Dec 20, 2022
@mfocko
Copy link
Member Author

mfocko commented Jan 12, 2023

Actually not an issue, cause it gets wrapped in GithubAPIException automatically, therefore the reason for failed permissions in #759 is unknown.

Corollary

The except block is unreachable, I will remove it tomorrow.

mfocko added a commit to mfocko/ogr that referenced this issue Sep 3, 2024
Remove the unreachable ‹except› block. Since the ‹collaborators› is
populated from a helper method that can produce only exceptions that
are wrapped in the ogr's exceptions (handled by the metaclass), hence
the ‹github.GithubException› cannot be raised.

Fixes packit#760

Signed-off-by: Matej Focko <mfocko@redhat.com>
@mfocko mfocko moved this from backlog to in-review in Packit Kanban Board Sep 3, 2024
@github-project-automation github-project-automation bot moved this from in-review to done in Packit Kanban Board Sep 4, 2024
softwarefactory-project-zuul bot added a commit that referenced this issue Sep 4, 2024
fix: remove unreachable exception handling

Remove the unreachable ‹except› block. Since the ‹collaborators› is populated from a helper method that can produce only exceptions that are wrapped in the ogr's exceptions (handled by the metaclass), hence the ‹github.GithubException› cannot be raised.
Fixes #760

Reviewed-by: Laura Barcziová
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/github Related to GitHub implementation. 🌞 friday 🤟 Weekend is coming! good-first-issue Good for newcomers. kind/bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant