Skip to content

Correctly wrap GraphQl error#2149

Merged
almaleksia merged 1 commit intomainfrom
almaleksia/graphql-error-wrapping
Mar 5, 2026
Merged

Correctly wrap GraphQl error#2149
almaleksia merged 1 commit intomainfrom
almaleksia/graphql-error-wrapping

Conversation

@almaleksia
Copy link
Contributor

Summary

We shouldn't drop error returned by graphql client in fetchIssueIDs

Why

Fixes #2067

What changed

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@almaleksia almaleksia requested a review from a team as a code owner March 5, 2026 11:23
Copilot AI review requested due to automatic review settings March 5, 2026 11:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes loss of underlying GraphQL query errors in fetchIssueIDs, improving diagnostics for callers (notably update_issue when closing/reopening issues via GraphQL).

Changes:

  • Wrap GraphQL client query errors with %w in fetchIssueIDs (both single-ID and dual-ID query paths), preserving the root cause for downstream error reporting.

@almaleksia almaleksia merged commit f582083 into main Mar 5, 2026
20 checks passed
@almaleksia almaleksia deleted the almaleksia/graphql-error-wrapping branch March 5, 2026 14:30
kristentr added a commit to kristentr/github-mcp-server that referenced this pull request Mar 5, 2026
* Stricter matching for github.com and ghe.com URLs

* Gracefully handle numeric parameters passed as strings (github#2130)

* Gracefully handle numeric parameters passed as strings

* Fix SHA validation in create_or_update_file (github#2134)

* Fix SHA validation in create_or_update_file

* Doc update

* Handle non-404 errors

* Handle directory paths

* Update instructions

* fix: handle empty files in get_file_contents (github#2042)

1. Empty (0-byte) files caused an unhandled error because the GitHub API
   returns null content with base64 encoding for them; GetContent() fails
   with "malformed response: base64 encoding of null content". Return
   empty text/plain content directly, bypassing decoding entirely.

Co-authored-by: Ksenia Bobrova <almaleksia@github.com>

* Cline & Roo code installation guides (github#2146)

* Cline & Roo code installation guides

* Update docs/installation-guides/install-cline.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correctly wrap GraphQl error (github#2149)

---------

Co-authored-by: Ksenia Bobrova <almaleksia@github.com>
Co-authored-by: Jakub Janusz <32165716+kubajanusz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Bug: fetchIssueIDs discards GraphQL error — callers receive static "failed to get issue ID" with no root cause

3 participants