From 67ab8dbfa574ce950b0cb72d7ecd75e080fc4dd7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 25 Mar 2016 19:43:34 +0800 Subject: [PATCH] protocols/pc_rpc: short_exc_info --- artiq/protocols/pc_rpc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/artiq/protocols/pc_rpc.py b/artiq/protocols/pc_rpc.py index d4484dfc2..bc19f7c5e 100644 --- a/artiq/protocols/pc_rpc.py +++ b/artiq/protocols/pc_rpc.py @@ -510,9 +510,13 @@ class Server(_AsyncioServer): .format(obj["action"])) except asyncio.CancelledError: raise - except: + except Exception as exc: + short_exc_info = type(exc).__name__ + exc_str = str(exc) + if exc_str: + short_exc_info += ": " + exc_str.splitlines()[0] return {"status": "failed", - "message": traceback.format_exc()} + "message": short_exc_info + "\n" + traceback.format_exc()} finally: if self._noparallel is not None: self._noparallel.release()