Skip to content

Commit

Permalink
Merge pull request #79 from TurunWappuradio/chore/better-showlist-error
Browse files Browse the repository at this point in the history
Chore: Kuvaavampi virheviesti ohjelmakartan parsimisessa
  • Loading branch information
niemisami authored Apr 14, 2024
2 parents fcb83e2 + dcf7aea commit 5c8b71f
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 5c8b71f

Please sign in to comment.