There was an error while loading. Please reload this page.
1 parent 69e98b3 commit c19dc22Copy full SHA for c19dc22
1 file changed
lib/GoogleSpreadsheet.js
@@ -97,10 +97,12 @@ class GoogleSpreadsheet {
97
async _handleAxiosErrors(error) {
98
// console.log(error);
99
if (error.response && error.response.data) {
100
+ // usually the error has a code and message, but occasionally not
101
+ if (!error.response.data.error) throw error;
102
+
103
const { code, message } = error.response.data.error;
104
error.message = `Google API error - [${code}] ${message}`;
105
throw error;
- // throw new Error(`Google API error - [${code}] ${message}`);
106
}
107
108
if (_.get(error, 'response.status') === 403) {
0 commit comments