Skip to content

Commit

Permalink
Add proper error message for showlist parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
niemisami committed Apr 13, 2024
1 parent b7c0c47 commit dcf7aea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/google/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ export const parseSheetToShowList = async (
return acc;
}
const shows = await acc;
if (index > 0 && !shows[index - 1]) {
throw new Error(
`Failed to parse showlist sheet. Invalid data before ${JSON.stringify(
sheetRow
)}`
);
}

const previousEndTime = index ? shows[index - 1].end : showStartTime;
const startDate = new Date(previousEndTime);
Expand Down

0 comments on commit dcf7aea

Please sign in to comment.