@@ -98,7 +98,7 @@ func (o *teamResourceType) List(ctx context.Context, parentID *v2.ResourceId, pt
9898 teams , resp , err := o .client .Teams .ListTeams (ctx , orgName , opts )
9999 if err != nil {
100100 if isRatelimited (resp ) {
101- return nil , "" , nil , uhttp .WrapErrors (codes .Unavailable , "too many requests" , err )
101+ return nil , "" , nil , uhttp .WrapErrorsWithRateLimitInfo (codes .Unavailable , resp . Response , err )
102102 }
103103 return nil , "" , nil , fmt .Errorf ("github-connector: failed to list teams: %w" , err )
104104 }
@@ -112,7 +112,7 @@ func (o *teamResourceType) List(ctx context.Context, parentID *v2.ResourceId, pt
112112 fullTeam , resp , err := o .teamCache .GetTeam (ctx , orgID , team .GetID ())
113113 if err != nil {
114114 if isRatelimited (resp ) {
115- return nil , "" , nil , uhttp .WrapErrors (codes .Unavailable , "too many requests" , err )
115+ return nil , "" , nil , uhttp .WrapErrorsWithRateLimitInfo (codes .Unavailable , resp . Response , err )
116116 }
117117 return nil , "" , nil , err
118118 }
@@ -175,7 +175,7 @@ func (o *teamResourceType) Grants(ctx context.Context, resource *v2.Resource, pT
175175 org , resp , err := o .client .Organizations .GetByID (ctx , orgID )
176176 if err != nil {
177177 if isRatelimited (resp ) {
178- return nil , "" , nil , uhttp .WrapErrors (codes .Unavailable , "too many requests" , err )
178+ return nil , "" , nil , uhttp .WrapErrorsWithRateLimitInfo (codes .Unavailable , resp . Response , err )
179179 }
180180 return nil , "" , nil , err
181181 }
@@ -214,7 +214,7 @@ func (o *teamResourceType) Grants(ctx context.Context, resource *v2.Resource, pT
214214 return nil , "" , nil , uhttp .WrapErrors (codes .NotFound , fmt .Sprintf ("org: %d not found" , org .GetID ()))
215215 }
216216 if isRatelimited (resp ) {
217- return nil , "" , nil , uhttp .WrapErrors (codes .Unavailable , "too many requests" , err )
217+ return nil , "" , nil , uhttp .WrapErrorsWithRateLimitInfo (codes .Unavailable , resp . Response , err )
218218 }
219219 return nil , "" , nil , fmt .Errorf ("github-connectorv2: failed to fetch team members: %w" , err )
220220 }
0 commit comments