mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Make get_file and save_file handle StopTransmission errors
This commit is contained in:
parent
6b63e88de7
commit
b37d4dc7ec
@ -1368,6 +1368,8 @@ class Client(Methods, BaseClient):
|
|||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(self, min(file_part * part_size, file_size), file_size, *progress_args)
|
progress(self, min(file_part * part_size, file_size), file_size, *progress_args)
|
||||||
|
except Client.StopTransmission:
|
||||||
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
else:
|
else:
|
||||||
@ -1569,7 +1571,8 @@ class Client(Methods, BaseClient):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
if not isinstance(e, Client.StopTransmission):
|
||||||
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove(file_name)
|
os.remove(file_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user