Skip to content

prs: surface real gh CLI error instead of generic auth message#1813

Open
adagr8-web wants to merge 1 commit into
Graphify-Labs:v8from
adagr8-web:fix/surface-gh-cli-errors
Open

prs: surface real gh CLI error instead of generic auth message#1813
adagr8-web wants to merge 1 commit into
Graphify-Labs:v8from
adagr8-web:fix/surface-gh-cli-errors

Conversation

@adagr8-web

Copy link
Copy Markdown

_gh() previously collapsed every failure mode (nonzero exit, timeout, bad JSON, missing binary) into a bare None, so fetch_prs() always raised the same 'gh CLI not found or not authenticated' RuntimeError regardless of the actual cause. This made a wrong --repo value (or any other real failure) indistinguishable from an auth problem, leading to hours of debugging auth/PATH/env when the server-side setup was correct the whole time.

Now _gh() optionally collects the real stderr/exception detail via an _errors list, and fetch_prs() surfaces it in the exception message. Fully backward compatible — callers that don't pass _errors behave exactly as before.

_gh() previously collapsed every failure mode (nonzero exit, timeout,
bad JSON, missing binary) into a bare None, so fetch_prs() always
raised the same 'gh CLI not found or not authenticated' RuntimeError
regardless of the actual cause. This made a wrong --repo value (or
any other real failure) indistinguishable from an auth problem,
leading to hours of debugging auth/PATH/env when the server-side
setup was correct the whole time.

Now _gh() optionally collects the real stderr/exception detail via
an _errors list, and fetch_prs() surfaces it in the exception message.
Fully backward compatible — callers that don't pass _errors behave
exactly as before.
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