NewGitHubRawAPIErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware
(ctx context.Context, message string, resp *http.Response, err error)
| 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 { |
| 207 | rawErr := newGitHubRawAPIError(message, resp, err) |
| 208 | if ctx != nil { |
| 209 | _, _ = addRawAPIErrorToContext(ctx, rawErr) // Explicitly ignore error for graceful handling |
| 210 | } |
| 211 | return utils.NewToolResultErrorFromErr(message, err) |
| 212 | } |
| 213 | |
| 214 | // NewGitHubAPIStatusErrorResponse handles cases where the API call succeeds (err == nil) |
| 215 | // but returns an unexpected HTTP status code. It creates a synthetic error from the |
nothing calls this directly
no test coverage detected