From 74b3c47614f68ce636f6926751c26d7c243e1aae Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 25 Mar 2016 20:04:53 +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 c9f53b286..17ef89ae2 100644 --- a/artiq/protocols/pc_rpc.py +++ b/artiq/protocols/pc_rpc.py @@ -518,9 +518,13 @@ class Server(_AsyncioServer): else: raise ValueError("Unknown action: {}" .format(obj["action"])) - except Exception: + except Exception as exc: + short_exc_info = type(exc).__name__ + exc_str = str(exc) + if exc_str: + short_exc_info += ": " + exc_str.splitlines()[0] obj = {"status": "failed", - "message": traceback.format_exc()} + "message": short_exc_info + "\n" + traceback.format_exc()} line = pyon.encode(obj) + "\n" writer.write(line.encode()) except (ConnectionResetError, ConnectionAbortedError, BrokenPipeError):