diff --git a/src/wormhole/cli/cli.py b/src/wormhole/cli/cli.py index 9ce3d07..9b202b9 100644 --- a/src/wormhole/cli/cli.py +++ b/src/wormhole/cli/cli.py @@ -9,7 +9,7 @@ from . import public_relay from .. import __version__ from ..timing import DebugTiming from ..errors import (WrongPasswordError, WelcomeError, KeyFormatError, - TransferError) + TransferError, NoTorError) from twisted.internet.defer import inlineCallbacks, maybeDeferred from twisted.python.failure import Failure from twisted.internet.task import react @@ -104,7 +104,7 @@ def _dispatch_command(reactor, cfg, command): try: yield maybeDeferred(command) - except (WrongPasswordError, KeyFormatError) as e: + except (WrongPasswordError, KeyFormatError, NoTorError) as e: msg = fill("ERROR: " + dedent(e.__doc__)) print(msg, file=stderr) raise SystemExit(1) diff --git a/src/wormhole/errors.py b/src/wormhole/errors.py index cf039fd..7eff520 100644 --- a/src/wormhole/errors.py +++ b/src/wormhole/errors.py @@ -55,3 +55,6 @@ class WormholeClosedError(InternalError): class TransferError(Exception): """Something bad happened and the transfer failed.""" + +class NoTorError(Exception): + """--tor was requested, but 'txtorcon' is not installed."""