empty kata analysis/other prob handling

This commit is contained in:
Sander Land committed 2020-02-04 22:43:36 +01:00
1 parent da4262de7c
commit 4a6d1828d3
1 file changed
+2 -2
+2 -2
View File
@@ -179,13 +179,13 @@ class EngineControls(GridLayout):
self._send_analysis_query(self.outstanding_analysis_queries.pop(0))
line = self.kata.stdout.readline()
if self.debug:
print("KATA ANALYSIS RECEIVED:", line[:50])
print("KATA ANALYSIS RECEIVED:", line[:50], "...")
if not line: # occasionally happens?
return
try:
analysis = json.loads(line)
except json.JSONDecodeError as e:
print("JSON decode error", e, "on input", line)
print(f"JSON decode error: '{e}' encountered after receiving input '{line}'")
return
self.board.store_analysis(analysis)
self.update_evaluation()