MCPcopy
hub / github.com/github/github-mcp-server / addGitHubAPIErrorToContext

Function addGitHubAPIErrorToContext

pkg/errors/error.go:133–139  ·  view source on GitHub ↗
(ctx context.Context, err *GitHubAPIError)

Source from the content-addressed store, hash-verified

131}
132
133func addGitHubAPIErrorToContext(ctx context.Context, err *GitHubAPIError) (context.Context, error) {
134 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {
135 val.api = append(val.api, err) // append the error to the existing slice in the context
136 return ctx, nil
137 }
138 return nil, fmt.Errorf("context does not contain GitHubCtxErrors")
139}
140
141func addGitHubGraphQLErrorToContext(ctx context.Context, err *GitHubGraphQLError) (context.Context, error) {
142 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {

Callers 2

NewGitHubAPIErrorToCtxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected