cosmetic cleanups to error messages

This commit is contained in:
Brian Warner 2016-04-25 18:24:39 -07:00
parent 2a6767ee6f
commit c017de5e4b
2 changed files with 4 additions and 4 deletions

View File

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

View File

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