Skip to content

Commit b4b96f9

Browse files
committed
Refactor: Use handleHttpStatus in fetcher.js - Modifies the function responsible for making HTTP requests to use the new handleHttpStatus function.
1 parent a617535 commit b4b96f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GithubHttpApp/fetcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function fetcher(GH_TOKEN, URL) {
2020
const response = await UrlFetchApp.fetch(pageUrl, options);
2121

2222
if (response.getResponseCode() !== 200) {
23-
throw new Error(`API request failed with status ${response.getResponseCode()}: ${response.getContentText()}`);
23+
return handleHttpStatus(response.getResponseCode());
2424
}
2525

2626
const data = JSON.parse(response.getContentText());

0 commit comments

Comments
 (0)