Skip to content

Log gh stderr on IssueTracker shell failures#172

Merged
dhilgaertner merged 1 commit intomainfrom
feature/crow-170-log-gh-stderr
Apr 15, 2026
Merged

Log gh stderr on IssueTracker shell failures#172
dhilgaertner merged 1 commit intomainfrom
feature/crow-170-log-gh-stderr

Conversation

@dhilgaertner
Copy link
Copy Markdown
Contributor

Summary

  • IssueTracker.shell() and shellSync() now capture gh stderr and embed it in the thrown NSError via NSLocalizedDescriptionKey, so existing print("... failed: \(error)") call sites render the real failure cause instead of Code=1 "(null)".
  • Fix applies uniformly to all 9 polling call sites (GitHub issues/PRs/project statuses, PR/issue close checks, GitLab issues) with no call-site edits.
  • Bonus gh auth failure → one-time notification is deferred per plan — log-first, then target the follow-up once real stderr patterns are known.

Closes #170

Test plan

  • make build succeeds.
  • Trigger a controlled gh failure (e.g. temporarily move ~/.config/gh), wait for a poll cycle, confirm [IssueTracker] ... failed: lines include the real stderr (HTTP 401, authentication required, etc.).
  • Restore auth, confirm steady-state polling is clean with no spurious error logs.

🤖 Generated with Claude Code

The shell() and shellSync() helpers piped stderr to an unread Pipe() and
threw NSError with no userInfo, so every gh failure logged as
`Code=1 "(null)"` with no diagnostic info. Capture stderr and surface it
via NSLocalizedDescriptionKey so existing catch-site prints render the
real cause.

Closes #170

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner requested a review from dgershman as a code owner April 15, 2026 15:40
@dhilgaertner dhilgaertner merged commit 3e2d97e into main Apr 15, 2026
1 check passed
@dhilgaertner dhilgaertner deleted the feature/crow-170-log-gh-stderr branch April 15, 2026 15:41
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.

IssueTracker: API failures log bare Code=1 "(null)" — stderr discarded, root cause unknowable

1 participant