Skip to content

Commit ca19315

Browse files
committed
[INC-300] baton-github: include the error in the returned message
1 parent f903bb1 commit ca19315

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/connector/connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ 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("access token must be an admin on the %s organization", o)
183+
return nil, fmt.Errorf("access token must be an admin on the %s organization: %w", o, err)
184184
}
185185
continue
186186
}
187187

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+
return nil, fmt.Errorf("access token must be an admin on the %s organization: %w", o, err)
192192
}
193193
continue
194194
}

0 commit comments

Comments
 (0)