From c3ce476cc44be6ed61a8a8fa0adda895495153af Mon Sep 17 00:00:00 2001 From: Niallfitzy1 Date: Fri, 18 Oct 2024 16:58:48 +0100 Subject: [PATCH] chore: throw explicit error if missing spreadsheetUrl --- src/lib/GoogleSpreadsheet.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/GoogleSpreadsheet.ts b/src/lib/GoogleSpreadsheet.ts index 5ecee5c..1b90afe 100644 --- a/src/lib/GoogleSpreadsheet.ts +++ b/src/lib/GoogleSpreadsheet.ts @@ -303,6 +303,10 @@ export class GoogleSpreadsheet { ...includeCells && { includeGridData: true }, }, }); + if (!response.data?.spreadsheetUrl) { + throw new Error(`Failed to load document info. Status: ${response.status}, Status Text: ${response.statusText}, Data: ${response.data}`); + } + this._spreadsheetUrl = response.data.spreadsheetUrl; this._rawProperties = response.data.properties; _.each(response.data.sheets, (s) => this._updateOrCreateSheet(s));