gdriveTools: Handle unhandled exception in clone method

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-04-05 14:12:13 +05:30
parent b84d4aca2c
commit 47dd3c2b6f

View File

@ -246,7 +246,14 @@ class GoogleDriveHelper:
def clone(self, link): def clone(self, link):
self.transferred_size = 0 self.transferred_size = 0
file_id = self.getIdFromUrl(link) try:
file_id = self.getIdFromUrl(link)
except KeyError:
msg = "Google drive ID could not be found in the provided link"
return msg
except IndexError:
msg = "Google drive ID could not be found in the provided link"
return msg
msg = "" msg = ""
LOGGER.info(f"File ID: {file_id}") LOGGER.info(f"File ID: {file_id}")
try: try: