GetGitHubRawAPIErrors retrieves the slice of GitHubRawAPIErrors from the context.
(ctx context.Context)
| 108 | |
| 109 | // GetGitHubRawAPIErrors retrieves the slice of GitHubRawAPIErrors from the context. |
| 110 | func 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 | |
| 117 | func NewGitHubAPIErrorToCtx(ctx context.Context, message string, resp *github.Response, err error) (context.Context, error) { |
| 118 | apiErr := newGitHubAPIError(message, resp, err) |
no outgoing calls