Handle new Tor controller errors in CLI

This commit is contained in:
Micah Lee 2016-12-29 10:16:20 -08:00
parent b8e797049b
commit ebf13cfa11
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,6 @@ class TorErrorUnreadableCookieFile(Exception):
"""
pass
class NoTor(Exception):
"""
This exception is raised if onionshare can't find a Tor control port

View File

@ -155,10 +155,11 @@ def main(cwd=None):
app = OnionShare(debug, local_only, stay_open, transparent_torification, stealth)
app.choose_port()
app.start_onion_service()
except onion.NoTor as e:
sys.exit(e.args[0])
except onion.TorTooOld as e:
except (onion.NoTor, onion.TorTooOld, onion.TorErrorInvalidSetting, onion.TorErrorSocketPort, onion.TorErrorSocketFile, onion.TorErrorMissingPassword, onion.TorErrorUnreadableCookieFile) as e:
sys.exit(e.args[0])
except KeyboardInterrupt:
print("")
sys.exit()
# prepare files to share
print(strings._("preparing_files"))