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:
Miguel Jacq 2018-01-14 20:36:43 +11:00
parent d9e6650a19
commit f656bafd4c
No known key found for this signature in database
GPG Key ID: 5418373DFF79BA19

View File

@ -98,8 +98,12 @@ def main(cwd=None):
# Prepare files to share
print(strings._("preparing_files"))
web.set_file_info(filenames)
app.cleanup_filenames.append(web.zip_filename)
try:
web.set_file_info(filenames)
app.cleanup_filenames.append(web.zip_filename)
except OSError as e:
print(e.strerror)
sys.exit(1)
# Warn about sending large files over Tor
if web.zip_filesize >= 157286400: # 150mb