GetGitHubAPIErrors retrieves the slice of GitHubAPIErrors from the context.
(ctx context.Context)
| 92 | |
| 93 | // GetGitHubAPIErrors retrieves the slice of GitHubAPIErrors from the context. |
| 94 | func 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. |
| 102 | func GetGitHubGraphQLErrors(ctx context.Context) ([]*GitHubGraphQLError, error) { |
no outgoing calls