summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HTTPParser.py7
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"]