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

Function GetGitHubRawAPIErrors

pkg/errors/error.go:110–115  ·  view source on GitHub ↗

GetGitHubRawAPIErrors retrieves the slice of GitHubRawAPIErrors from the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

108
109// GetGitHubRawAPIErrors retrieves the slice of GitHubRawAPIErrors from the context.
110func GetGitHubRawAPIErrors(ctx context.Context) ([]*GitHubRawAPIError, error) {
111 if val, ok := ctx.Value(GitHubErrorKey{}).(*GitHubCtxErrors); ok {
112 return val.raw, nil // return the slice of raw API errors from the context
113 }
114 return nil, fmt.Errorf("context does not contain GitHubCtxErrors")
115}
116
117func NewGitHubAPIErrorToCtx(ctx context.Context, message string, resp *github.Response, err error) (context.Context, error) {
118 apiErr := newGitHubAPIError(message, resp, err)

Callers 1

TestGitHubErrorContextFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGitHubErrorContextFunction · 0.68