Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.8k
Add API Error annotations to GitHub issue errors#1566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5df7fff0dcbe3e9fc64b738abdc9edab647File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1175,7 +1175,11 @@ func CreateIssue(ctx context.Context, client *github.Client, owner string, repo | ||||||
| issue, resp, err := client.Issues.Create(ctx, owner, repo, issueRequest) | ||||||
| if err != nil { | ||||||
| return utils.NewToolResultErrorFromErr("failed to create issue", err), nil | ||||||
| return ghErrors.NewGitHubAPIErrorResponse(ctx, | ||||||
| "failed to create issue", | ||||||
| resp, | ||||||
| err, | ||||||
| ), nil | ||||||
| } | ||||||
| defer func() { _ = resp.Body.Close() }() | ||||||
| @@ -1522,7 +1526,11 @@ func ListIssues(t translations.TranslationHelperFunc) inventory.ServerTool { | ||||||
| issueQuery := getIssueQueryType(hasLabels, hasSince) | ||||||
| if err := client.Query(ctx, issueQuery, vars); err != nil { | ||||||
| return utils.NewToolResultError(err.Error()), nil, nil | ||||||
| return ghErrors.NewGitHubGraphQLErrorResponse( | ||||||
| ctx, | ||||||
| "failed to list issues", | ||||||
| err, | ||||||
| ), nil, nil | ||||||
| } | ||||||
| // Extract and convert all issue nodes using the common interface | ||||||
| @@ -1683,7 +1691,7 @@ func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.Server | ||||||
| var query suggestedActorsQuery | ||||||
| err := client.Query(ctx, &query, variables) | ||||||
| if err != nil { | ||||||
| return nil, nil, err | ||||||
| return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get suggested actors", err), nil, nil | ||||||
CopilotAI | ||||||
| returnghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get suggested actors", err), nil, nil | |
| returnghErrors.NewGitHubGraphQLErrorResponse(ctx, "Failed to get suggested actors", err), nil, nil |
CopilotAIDec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message capitalization is inconsistent. The message "failed to get issue ID" uses lowercase "failed", while other nearby error messages in this file use uppercase "Failed" (e.g., "Failed to get issue labels" at line 518, "Failed to find issues" at line 1265). For consistency, this should use "Failed to get issue ID" with an uppercase F to match the existing pattern in this file.
| returnghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get issue ID", err), nil, nil | |
| returnghErrors.NewGitHubGraphQLErrorResponse(ctx, "Failed to get issue ID", err), nil, nil |
CopilotAIDec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message capitalization is inconsistent. The message "failed to list issues" uses lowercase "failed", while other nearby error messages in this file use uppercase "Failed" (e.g., "Failed to get issue labels" at line 518, "Failed to find issues" at line 1265). For consistency, this should use "Failed to list issues" with an uppercase F to match the existing pattern in this file.