Skip to content

Add error logging to GitHub App token requests#153

Merged
jonathonbyrdziak merged 1 commit intomasterfrom
fix/github-app-token-error-logging
Mar 25, 2026
Merged

Add error logging to GitHub App token requests#153
jonathonbyrdziak merged 1 commit intomasterfrom
fix/github-app-token-error-logging

Conversation

@jonathonbyrdziak
Copy link
Copy Markdown
Contributor

Summary

  • Adds HTTP status code and error message logging to getInstallationId() and generateInstallationToken() in GitHubApp.php
  • Previously these methods silently returned null on API failures, making it impossible to diagnose watcher token refresh issues
  • Now logs the specific HTTP status and GitHub error message (e.g. HTTP 401, 403, 500) before returning null

Test plan

  • Deploy to a server running the protocol watcher
  • Verify normal token refresh still works (no regressions)
  • Simulate a failure (e.g. revoke app permissions temporarily) and confirm the logs show the HTTP status and error message

🤖 Generated with Claude Code

Previously, getInstallationId() and generateInstallationToken() silently
swallowed API errors — returning null with no indication of what GitHub
actually returned. This made it impossible to diagnose token refresh
failures in the watcher logs.

Now both methods capture the HTTP status code and response body, logging
the specific error (e.g. HTTP 401, 403, 500) before returning null.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonathonbyrdziak jonathonbyrdziak merged commit aca5dd2 into master Mar 25, 2026
5 of 8 checks passed
@jonathonbyrdziak jonathonbyrdziak deleted the fix/github-app-token-error-logging branch March 25, 2026 15:07
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