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

Function GetGitHubAPIErrors

pkg/errors/error.go:94–99  ·  view source on GitHub ↗

GetGitHubAPIErrors retrieves the slice of GitHubAPIErrors from the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

92
93// GetGitHubAPIErrors retrieves the slice of GitHubAPIErrors from the context.
94func GetGitHubAPIErrors(ctx context.Context) ([]*GitHubAPIError, error) {
95 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {
96 return val.api, nil // return the slice of API errors from the context
97 }
98 return nil, fmt.Errorf("context does not contain GitHubCtxErrors")
99}
100
101// GetGitHubGraphQLErrors retrieves the slice of GitHubGraphQLErrors from the context.
102func GetGitHubGraphQLErrors(ctx context.Context) ([]*GitHubGraphQLError, error) {

Callers 3

TestGitHubErrorContextFunction · 0.85
TestMiddlewareScenarioFunction · 0.85
assertContextHasErrorFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestGitHubErrorContextFunction · 0.68
TestMiddlewareScenarioFunction · 0.68
assertContextHasErrorFunction · 0.68