NewGitHubGraphQLErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware
(ctx context.Context, message string, err error)
| 195 | |
| 196 | // NewGitHubGraphQLErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware |
| 197 | func NewGitHubGraphQLErrorResponse(ctx context.Context, message string, err error) *mcp.CallToolResult { |
| 198 | graphQLErr := newGitHubGraphQLError(message, err) |
| 199 | if ctx != nil { |
| 200 | _, _ = addGitHubGraphQLErrorToContext(ctx, graphQLErr) // Explicitly ignore error for graceful handling |
| 201 | } |
| 202 | return utils.NewToolResultErrorFromErr(message, err) |
| 203 | } |
| 204 | |
| 205 | // NewGitHubRawAPIErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware |
| 206 | func NewGitHubRawAPIErrorResponse(ctx context.Context, message string, resp *http.Response, err error) *mcp.CallToolResult { |