mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-02 04:49:05 +00:00
refactor: add a try grourd to the cell data generator to better pinpoint errors
This commit is contained in:
@@ -412,15 +412,19 @@ export async function upload(sheetId: string, options: ImportMap) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// update the corresponding row with event data
|
try {
|
||||||
sheetOrder.forEach((entryId, index) => {
|
// update the corresponding row with event data
|
||||||
const isGroupEnd = entryId.startsWith('group-end-');
|
sheetOrder.forEach((entryId, index) => {
|
||||||
const id = isGroupEnd ? entryId.split('group-end-')[1] : entryId;
|
const isGroupEnd = entryId.startsWith('group-end-');
|
||||||
const entry = isGroupEnd
|
const id = isGroupEnd ? entryId.split('group-end-')[1] : entryId;
|
||||||
|
const entry = isGroupEnd
|
||||||
? ({ id: entryId, type: SupportedEntry.Group } as OntimeGroup)
|
? ({ id: entryId, type: SupportedEntry.Group } as OntimeGroup)
|
||||||
: 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,
|
||||||
|
|||||||
Reference in New Issue
Block a user