From c017de5e4b000d2874bc9c11cecba3c842a80e57 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 25 Apr 2016 18:24:39 -0700 Subject: [PATCH] cosmetic cleanups to error messages --- src/wormhole/cli/cmd_receive.py | 2 +- src/wormhole/cli/cmd_send.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index 73dceb4..8dadd02 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -117,7 +117,7 @@ class TwistedReceiver: them_bytes = yield w.get_data() them_d = json.loads(them_bytes.decode("utf-8")) if "error" in them_d: - raise TransferError(u"ERROR: " + them_d["error"]) + raise TransferError(them_d["error"]) returnValue(them_d) @inlineCallbacks diff --git a/src/wormhole/cli/cmd_send.py b/src/wormhole/cli/cmd_send.py index ce58372..e3a5871 100644 --- a/src/wormhole/cli/cmd_send.py +++ b/src/wormhole/cli/cmd_send.py @@ -91,10 +91,10 @@ def _send(reactor, w, args, phase1, fd_to_send, tor_manager): if ok.lower() == "yes": break if ok.lower() == "no": - reject_data = json.dumps({"error": "verification rejected", - }).encode("utf-8") + err = "sender rejected verification check, abandoned transfer" + reject_data = json.dumps({"error": err}).encode("utf-8") yield w.send_data(reject_data) - raise TransferError("verification rejected, abandoning transfer") + raise TransferError(err) if fd_to_send is not None: transit_key = w.derive_key(APPID+"/transit-key") transit_sender.set_transit_key(transit_key)