Skip to content

Commit

Permalink
chore(ci): add debug info for sheet fetch
Browse files Browse the repository at this point in the history
not clear in the workflow log whether fetch was successful or not since our error may return valid json
  • Loading branch information
sterlingwes committed Jan 21, 2024
1 parent b9cc9bc commit ebe6300
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/utils/gsheets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ export const fetchGoogleSheet = async (sheetTab: SheetTab) => {
const response = await fetch(sheetUrl, {
headers: { "x-token": token },
});

if (!response.ok || response.status !== 200) {
throw new Error(
`Failed to fetch worksheet "${sheetTab}", received ${response.status}`
);
}

return response.json() as Promise<GSheetsResponse>;
};

0 comments on commit ebe6300

Please sign in to comment.