From 5f8e10691dbef6a37cdc6a4a95928b0ea698fa3f Mon Sep 17 00:00:00 2001 From: Yostra Date: Wed, 1 Apr 2020 17:56:34 -0700 Subject: [PATCH] timelord catch exception on decode --- src/timelord.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/timelord.py b/src/timelord.py index 4ca7305b788a4..fa772eb79219e 100644 --- a/src/timelord.py +++ b/src/timelord.py @@ -261,7 +261,14 @@ class Timelord: self.done_discriminants.append(challenge_hash) break - if data.decode() == "STOP": + msg = "" + try: + msg = data.decode() + except Exception as e: + log.error(f"Exception while decoding data {e}") + pass + + if msg == "STOP": log.info(f"Stopped client running on ip {ip}.") async with self.lock: writer.write(b"ACK")