Skip to content

Commit 47dd3c2

Browse files
committed
gdriveTools: Handle unhandled exception in clone method
Signed-off-by: lzzy12 <[email protected]>
1 parent b84d4ac commit 47dd3c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bot/helper/mirror_utils/upload_utils/gdriveTools.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,14 @@ def copyFile(self, file_id, dest_id):
246246

247247
def clone(self, link):
248248
self.transferred_size = 0
249-
file_id = self.getIdFromUrl(link)
249+
try:
250+
file_id = self.getIdFromUrl(link)
251+
except KeyError:
252+
msg = "Google drive ID could not be found in the provided link"
253+
return msg
254+
except IndexError:
255+
msg = "Google drive ID could not be found in the provided link"
256+
return msg
250257
msg = ""
251258
LOGGER.info(f"File ID: {file_id}")
252259
try:

0 commit comments

Comments
 (0)