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

Function addGitHubGraphQLErrorToContext

pkg/errors/error.go:141–147  ·  view source on GitHub ↗
(ctx context.Context, err *GitHubGraphQLError)

Source from the content-addressed store, hash-verified

139}
140
141func addGitHubGraphQLErrorToContext(ctx context.Context, err *GitHubGraphQLError) (context.Context, error) {
142 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {
143 val.graphQL = append(val.graphQL, err) // append the error to the existing slice in the context
144 return ctx, nil
145 }
146 return nil, fmt.Errorf("context does not contain GitHubCtxErrors")
147}
148
149func addRawAPIErrorToContext(ctx context.Context, err *GitHubRawAPIError) (context.Context, error) {
150 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {

Callers 4

TestGitHubErrorContextFunction · 0.85
TestMiddlewareScenarioFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestGitHubErrorContextFunction · 0.68
TestMiddlewareScenarioFunction · 0.68