make the error message for the cli a bit more specific

This commit is contained in:
Chris Wolfe 2016-06-02 14:27:14 -07:00
parent bc7dea8bab
commit 65713d8652
2 changed files with 5 additions and 1 deletions

View File

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

View File

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