MCPcopy Index your code
hub / github.com/cli/cli / ProjectsV2IgnorableError

Function ProjectsV2IgnorableError

api/queries_projects_v2.go:330–342  ·  view source on GitHub ↗

When querying ProjectsV2 fields we generally don't want to show the user scope errors, field does not exist errors, or authorization errors. ProjectsV2IgnorableError checks against known error strings to see if an error can be safely ignored. Due to the fact that the GraphQLClient can return multipl

(err error)

Source from the content-addressed store, hash-verified

328// return multiple types of errors this uses brittle string comparison to check
329// against the known error strings.
330func ProjectsV2IgnorableError(err error) bool {
331 msg := err.Error()
332 if strings.Contains(msg, errorProjectsV2ReadScope) ||
333 strings.Contains(msg, errorProjectsV2UserField) ||
334 strings.Contains(msg, errorProjectsV2RepositoryField) ||
335 strings.Contains(msg, errorProjectsV2OrganizationField) ||
336 strings.Contains(msg, errorProjectsV2IssueField) ||
337 strings.Contains(msg, errorProjectsV2PullRequestField) ||
338 strings.Contains(msg, errorProjectsV2ResourceNotAccessible) {
339 return true
340 }
341 return false
342}

Callers 4

FindIssueOrPRFunction · 0.92
FindMethod · 0.92
v2ProjectsFunction · 0.85

Calls 2

ContainsMethod · 0.80
ErrorMethod · 0.45

Tested by 1