refactor: add a try grourd to the cell data generator to better pinpoint errors

This commit is contained in:
arc-alex
2025-09-17 13:16:11 +02:00
committed by Carlos Valente
parent a8fe8b5f1e
commit 02cddeec4d
@@ -412,6 +412,7 @@ export async function upload(sheetId: string, options: ImportMap) {
}, },
}); });
try {
// update the corresponding row with event data // update the corresponding row with event data
sheetOrder.forEach((entryId, index) => { sheetOrder.forEach((entryId, index) => {
const isGroupEnd = entryId.startsWith('group-end-'); const isGroupEnd = entryId.startsWith('group-end-');
@@ -421,6 +422,9 @@ export async function upload(sheetId: string, options: ImportMap) {
: structuredClone(rundown.entries[id]); : structuredClone(rundown.entries[id]);
updateRundown.push(cellRequestFromEvent(entry, index, worksheetId, sheetMetadata)); updateRundown.push(cellRequestFromEvent(entry, index, worksheetId, sheetMetadata));
}); });
} catch (e) {
throw new Error(`Sheet write failed to correctly parse rundown: ${e}`)
}
const writeResponse = await sheets({ version: 'v4', auth: currentAuthClient }).spreadsheets.batchUpdate({ const writeResponse = await sheets({ version: 'v4', auth: currentAuthClient }).spreadsheets.batchUpdate({
spreadsheetId: sheetId, spreadsheetId: sheetId,