Skip to content

Commit e28f3ff

Browse files
wrap error w permission denied code
1 parent f3e8742 commit e28f3ff

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
@@ -180,7 +180,8 @@ func (gh *GitHub) Validate(ctx context.Context) (annotations.Annotations, error)
180180
membership, _, err := gh.client.Organizations.GetOrgMembership(ctx, "", o)
181181
if err != nil {
182182
if filterOrgs {
183-
return nil, fmt.Errorf("can't get authenticated user on the %s organization: %w", o, err)
183+
err := fmt.Errorf("can't get authenticated user on the %s organization: %w", o, err)
184+
return nil, uhttp.WrapErrors(codes.PermissionDenied, "github-connector: credentials validation failed", err)
184185
}
185186
continue
186187
}

0 commit comments

Comments
 (0)