mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-24 14:30:29 -04:00
Catch the OSError in CLI mode when a file/folder can't be zipped up, and error out more gracefully
This commit is contained in:
parent
a7edf810c8
commit
2c22fcc2e0
1 changed files with 6 additions and 2 deletions
|
@ -98,8 +98,12 @@ def main(cwd=None):
|
||||||
|
|
||||||
# Prepare files to share
|
# Prepare files to share
|
||||||
print(strings._("preparing_files"))
|
print(strings._("preparing_files"))
|
||||||
|
try:
|
||||||
web.set_file_info(filenames)
|
web.set_file_info(filenames)
|
||||||
app.cleanup_filenames.append(web.zip_filename)
|
app.cleanup_filenames.append(web.zip_filename)
|
||||||
|
except OSError as e:
|
||||||
|
print(e.strerror)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Warn about sending large files over Tor
|
# Warn about sending large files over Tor
|
||||||
if web.zip_filesize >= 157286400: # 150mb
|
if web.zip_filesize >= 157286400: # 150mb
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue