From ab972785aa27ce32911de92e21157973d7295d73 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 8 Dec 2016 16:49:44 -0800 Subject: [PATCH] CLI: don't emit traceback for TransferErrors But do print the message contained therein refs #74 --- src/wormhole/cli/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wormhole/cli/cli.py b/src/wormhole/cli/cli.py index 42e4608..f994478 100644 --- a/src/wormhole/cli/cli.py +++ b/src/wormhole/cli/cli.py @@ -8,7 +8,8 @@ from sys import stdout, stderr from . import public_relay from .. import __version__ from ..timing import DebugTiming -from ..errors import WrongPasswordError, WelcomeError, KeyFormatError +from ..errors import (WrongPasswordError, WelcomeError, KeyFormatError, + TransferError) from twisted.internet.defer import inlineCallbacks, maybeDeferred from twisted.python.failure import Failure from twisted.internet.task import react @@ -110,6 +111,9 @@ def _dispatch_command(reactor, cfg, command): print(file=stderr) print(str(e), file=stderr) raise SystemExit(1) + except TransferError as e: + print("TransferError: %s" % str(e), file=stderr) + raise SystemExit(1) except Exception as e: # this prints a proper traceback, whereas # traceback.print_exc() just prints a TB to the "yield"