From d456af3a4b054bd59e4277100830e87c717e2855 Mon Sep 17 00:00:00 2001 From: manatlan Date: Mon, 3 Jun 2024 13:41:38 +0200 Subject: [PATCH] Update fifo.py --- htagweb/fifo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htagweb/fifo.py b/htagweb/fifo.py index e552faf..1e3d8f0 100644 --- a/htagweb/fifo.py +++ b/htagweb/fifo.py @@ -68,7 +68,10 @@ async def com(self,command:str,**args) -> "str|dict": # for client only frame = await fifo_in.readline() #print("Client receive:",frame) - c = json.loads(frame.strip()) + try: + c = json.loads(frame.strip()) + except Exception: + raise Exception(f"com error : {frame}") return c["response"] @@ -87,4 +90,4 @@ def destroy(self): os.kill(int(fid.readline().strip()),9) except ProcessLookupError: pass - self.removePipes() \ No newline at end of file + self.removePipes()