(ctx context.Context, err *GitHubRawAPIError)
| 147 | } |
| 148 | |
| 149 | func addRawAPIErrorToContext(ctx context.Context, err *GitHubRawAPIError) (context.Context, error) { |
| 150 | if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok { |
| 151 | val.raw = append(val.raw, err) |
| 152 | return ctx, nil |
| 153 | } |
| 154 | |
| 155 | return nil, fmt.Errorf("context does not contain GitHubCtxErrors") |
| 156 | } |
| 157 | |
| 158 | // NewGitHubAPIErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware |
| 159 | func NewGitHubAPIErrorResponse(ctx context.Context, message string, resp *github.Response, err error) *mcp.CallToolResult { |
no outgoing calls