Fixed null status code issue for Google sheets plugin (#3026)

This commit is contained in:
Muhsin Shah C P 2022-05-11 10:52:55 +05:30 committed by GitHub
parent 84c10583d9
commit 4b9f49eb41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ export default class GooglesheetsQueryService implements QueryService {
} catch (error) {
console.log(error.response);
if (error.response.statusCode === 401) {
if (error?.response?.statusCode === 401) {
throw new OAuthUnauthorizedClientError('Query could not be completed', error.message, { ...error });
}
throw new QueryError('Query could not be completed', error.message, {});