From b0d697ca56899d70b42ba665b217ac45ef25c3ee Mon Sep 17 00:00:00 2001 From: Max Risuhin Date: Sun, 17 Nov 2019 11:34:43 -0800 Subject: [PATCH] Handle GetList HttpError exceptions properly --- pydrive/files.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pydrive/files.py b/pydrive/files.py index 1d40304..2916d3f 100644 --- a/pydrive/files.py +++ b/pydrive/files.py @@ -64,9 +64,11 @@ def _GetList(self): self['corpus'] = 'DEFAULT' self['supportsTeamDrives'] = True self['includeTeamDriveItems'] = True - - self.metadata = self.auth.service.files().list(**dict(self)).execute( - http=self.http) + try: + self.metadata = self.auth.service.files().list(**dict(self)).execute( + http=self.http) + except errors.HttpError as error: + raise ApiRequestError(error) result = [] for file_metadata in self.metadata['items']: