From 65713d865203744fc89b062c5f803c06e8b26397 Mon Sep 17 00:00:00 2001 From: Chris Wolfe Date: Thu, 2 Jun 2016 14:27:14 -0700 Subject: [PATCH] make the error message for the cli a bit more specific --- src/wormhole/cli/runner.py | 3 +++ src/wormhole/errors.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wormhole/cli/runner.py b/src/wormhole/cli/runner.py index a15a50e..8c373b1 100644 --- a/src/wormhole/cli/runner.py +++ b/src/wormhole/cli/runner.py @@ -60,6 +60,9 @@ def run(reactor, argv, cwd, stdout, stderr, executable=None): print(msg, file=stderr) print(file=stderr) print(str(f.value), file=stderr) + elif f.check(KeyFormatError): + msg = textwrap.fill("ERROR: " + textwrap.dedent(f.value.__doc__)) + print(msg, file=stderr) else: print("ERROR:", f.value, file=stderr) raise SystemExit(1) diff --git a/src/wormhole/errors.py b/src/wormhole/errors.py index 2a271c6..47b9c2e 100644 --- a/src/wormhole/errors.py +++ b/src/wormhole/errors.py @@ -39,7 +39,8 @@ class WrongPasswordError(Exception): class KeyFormatError(Exception): """ The key you entered contains spaces. Magic-wormhole expects keys to be - separated by dashes. + separated by dashes. Please reenter the key you were given separating the + words with dashes. """ class ReflectionAttack(Exception):