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):