Skip to content

Commit 3fe6993

Browse files
Merge pull request #104 from ConductorOne/bugfix/wrap_error_w_permission_code
[BB-1313] wrap error w permission denied code
2 parents f3e8742 + e28f3ff commit 3fe6993

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)