mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
Make get_file and save_file handle StopTransmission errors
This commit is contained in:
parent
6b63e88de7
commit
b37d4dc7ec
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Reference in a new issue