diff options
-rw-r--r-- | src/HTTPParser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/HTTPParser.py b/src/HTTPParser.py index 47c2204..912a7cf 100644 --- a/src/HTTPParser.py +++ b/src/HTTPParser.py @@ -34,7 +34,12 @@ class HTTPParser: if not self.contentLen == 0: msgs = self.headersAlone.rstrip().split('\n') cmd = msgs[len(msgs) - 1] - jsoncmd = json.loads(cmd) + try: + jsoncmd = json.loads(cmd) + except ValueError as e: + print ("Error: Json message incomplete") + return + if "run" in cmd: self.cmd = jsoncmd["run"] |