Add group in the error message from the graphQL query

Signed-off-by: Jasper Boeijenga <jboeijenga@gmail.com>
This commit is contained in:
Jasper Boeijenga
2023-10-11 13:00:35 +02:00
parent ee87bef456
commit 1150a8cdec
2 changed files with 6 additions and 2 deletions
@@ -236,7 +236,11 @@ export class GitLabClient {
},
).then(r => r.json());
if (response.errors) {
throw new Error(`GraphQL errors: ${JSON.stringify(response.errors)}`);
throw new Error(
`GraphQL errors: ${JSON.stringify(
response.errors,
)}, for group: ${groupPath}`,
);
}
if (!response.data.group?.groupMembers?.nodes) {
@@ -249,7 +249,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
try {
groupUsers = await client.getGroupMembers(group.full_path, ['DIRECT']);
} catch {
logger.error(`Failed fetching user for group: ${group.full_path}`);
logger.error(`Failed fetching users for group: ${group.full_path}`);
}
for (const groupUser of groupUsers.items) {