@@ -13,9 +13,11 @@ import (
1313 "github.com/conductorone/baton-sdk/pkg/types/entitlement"
1414 "github.com/conductorone/baton-sdk/pkg/types/grant"
1515 "github.com/conductorone/baton-sdk/pkg/types/resource"
16+ "github.com/conductorone/baton-sdk/pkg/uhttp"
1617 "github.com/google/go-github/v69/github"
1718 "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
1819 "go.uber.org/zap"
20+ "google.golang.org/grpc/codes"
1921)
2022
2123// outside collaborators are given one of these roles too.
@@ -176,6 +178,9 @@ func (o *repositoryResourceType) Grants(
176178 }
177179 return nil , pageToken , nil , nil
178180 }
181+ if isNotFoundError (resp ) {
182+ return nil , "" , nil , uhttp .WrapErrors (codes .NotFound , fmt .Sprintf ("repo: %s not found" , resource .DisplayName ))
183+ }
179184 return nil , "" , nil , fmt .Errorf ("github-connector: failed to list repos: %w" , err )
180185 }
181186
@@ -224,6 +229,10 @@ func (o *repositoryResourceType) Grants(
224229 }
225230 return nil , pageToken , nil , nil
226231 }
232+
233+ if isNotFoundError (resp ) {
234+ return nil , "" , nil , uhttp .WrapErrors (codes .NotFound , fmt .Sprintf ("repo: %s not found" , resource .DisplayName ))
235+ }
227236 return nil , "" , nil , fmt .Errorf ("github-connector: failed to list repos: %w" , err )
228237 }
229238
0 commit comments