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

Function NewGitHubAPIErrorToCtx

pkg/errors/error.go:117–123  ·  view source on GitHub ↗
(ctx context.Context, message string, resp *github.Response, err error)

Source from the content-addressed store, hash-verified

115}
116
117func NewGitHubAPIErrorToCtx(ctx context.Context, message string, resp *github.Response, err error) (context.Context, error) {
118 apiErr := newGitHubAPIError(message, resp, err)
119 if ctx != nil {
120 _, _ = addGitHubAPIErrorToContext(ctx, apiErr) // Explicitly ignore error for graceful handling
121 }
122 return ctx, nil
123}
124
125func NewGitHubGraphQLErrorToCtx(ctx context.Context, message string, err error) (context.Context, error) {
126 graphQLErr := newGitHubGraphQLError(message, err)

Callers 2

TestGitHubErrorContextFunction · 0.85
TestMiddlewareScenarioFunction · 0.85

Calls 2

newGitHubAPIErrorFunction · 0.85

Tested by 2

TestGitHubErrorContextFunction · 0.68
TestMiddlewareScenarioFunction · 0.68