Skip to content

Commit ee6819d

Browse files
wrap error with permission denied code
1 parent 1622d2d commit ee6819d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/connector/connector.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ func (gh *GitHub) Validate(ctx context.Context) (annotations.Annotations, error)
188188
// Only sync orgs that we are an admin for
189189
if strings.ToLower(membership.GetRole()) != orgRoleAdmin {
190190
if filterOrgs {
191-
return nil, fmt.Errorf("access token must be an admin on the %s organization", o)
191+
err := fmt.Errorf("access token must be an admin on the %s organization", o)
192+
return nil, uhttp.WrapErrors(codes.PermissionDenied, "github-connector: credentials validation failed", err)
192193
}
193194
continue
194195
}

0 commit comments

Comments
 (0)