Skip to content

feat(signature): distinguish HTTP auth errors from network outages#102

Merged
benner merged 1 commit into
mainfrom
feat/distinguish-github-api-auth-errors
May 6, 2026
Merged

feat(signature): distinguish HTTP auth errors from network outages#102
benner merged 1 commit into
mainfrom
feat/distinguish-github-api-auth-errors

Conversation

@benner
Copy link
Copy Markdown
Owner

@benner benner commented May 6, 2026

A rotated GITHUB_TOKEN previously surfaced as "GitHub API unreachable"
because _resolve_github_username swallowed every Commits API HTTPError
except 404, and the outer handler only knew URLError. Re-raise 401/403
from the Commits API and split HTTPError out of URLError so 401, 403,
and other codes each get a distinct message.

A rotated GITHUB_TOKEN previously surfaced as "GitHub API unreachable"
because _resolve_github_username swallowed every Commits API HTTPError
except 404, and the outer handler only knew URLError. Re-raise 401/403
from the Commits API and split HTTPError out of URLError so 401, 403,
and other codes each get a distinct message.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Coverage

Coverage Report (Δ +0.0%)
FileStmtsMissCoverMissing
src/git_commit_guard
   __init__.py5010100% 
TOTAL5010100% 

@benner benner marked this pull request as ready for review May 6, 2026 16:23
@benner benner merged commit 2103a75 into main May 6, 2026
7 checks passed
@benner benner deleted the feat/distinguish-github-api-auth-errors branch May 6, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant