diff --git a/api/queries_repo.go b/api/queries_repo.go index d63888cef..1b0f00ade 100644 --- a/api/queries_repo.go +++ b/api/queries_repo.go @@ -3,6 +3,7 @@ package api import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -422,8 +423,8 @@ func RepoNetwork(client *Client, repos []ghrepo.Interface) (RepoNetworkResult, e %s } `, strings.Join(queries, "")), nil, &graphqlResult) - graphqlError, isGraphQLError := err.(*GraphQLError) - if isGraphQLError { + var graphqlError GraphQLError + if errors.As(err, &graphqlError) { // If the only errors are that certain repositories are not found, // continue processing this response instead of returning an error tolerated := true diff --git a/pkg/cmd/status/status.go b/pkg/cmd/status/status.go index 7a19d07dd..69a53686e 100644 --- a/pkg/cmd/status/status.go +++ b/pkg/cmd/status/status.go @@ -441,7 +441,7 @@ func (s *StatusGetter) LoadSearchResults() error { if len(gqlErrors) == 0 { err = nil } else { - err = &api.GraphQLError{ + err = api.GraphQLError{ GQLError: ghAPI.GQLError{ Errors: gqlErrors, },