Skip to content

Commit 7228589

Browse files
authored
better logs for GH API response errors (#2336)
1 parent 12ec29f commit 7228589

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/helpers.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ export async function makeGraphqlQuery(query: string, variables = {}) {
1919
variables,
2020
}),
2121
});
22-
return await result.json();
22+
try {
23+
return await result.json();
24+
} catch (error: unknown) {
25+
console.error('GitHub GraphQL response parse failed!', {
26+
status: result.status,
27+
statusText: result.statusText,
28+
error: error instanceof Error ? error.message : String(error),
29+
body: result.body,
30+
});
31+
throw error;
32+
}
2333
}
2434

2535
export async function getUpdatedUrl(url: string) {

0 commit comments

Comments
 (0)