Skip to content

Commit 005152d

Browse files
authored
fix: surface gh stderr on GraphQL failure in pr-triage CLI (#1082)
1 parent c4609a3 commit 005152d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.agents/skills/pr-triage/scripts/triage.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,10 @@ def fetch_github_data(
497497
"-f",
498498
f"query={GRAPHQL_QUERY}",
499499
]
500-
proc = subprocess.run(cmd, check=True, capture_output=True, text=True)
500+
proc = subprocess.run(cmd, check=False, capture_output=True, text=True)
501+
if proc.returncode != 0:
502+
detail = proc.stderr.strip() or proc.stdout.strip() or f"exit code {proc.returncode}"
503+
raise RuntimeError(f"gh api graphql failed: {detail}")
501504
payload: dict[str, Any] = json.loads(proc.stdout)
502505
if payload.get("errors"):
503506
raise RuntimeError(f"GraphQL errors: {payload['errors']}")

0 commit comments

Comments
 (0)