Skip to content

Commit

Permalink
chore: throw explicit error if missing spreadsheetUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Niallfitzy1 committed Oct 18, 2024
1 parent 2eae4ae commit c3ce476
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/GoogleSpreadsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit c3ce476

Please sign in to comment.