From 893c18679ffbb56270febc69f4c535b9a4b4eca6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 13 Jan 2015 17:27:36 +0800 Subject: [PATCH] management/worker: improve error reporting --- artiq/management/worker.py | 4 +++- artiq/management/worker_impl.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/management/worker.py b/artiq/management/worker.py index e401fc6de..aa6d4ec99 100644 --- a/artiq/management/worker.py +++ b/artiq/management/worker.py @@ -2,6 +2,7 @@ import sys import asyncio import subprocess import signal +import traceback from artiq.management import pyon @@ -78,7 +79,8 @@ class Worker: data = self.handlers[action](**obj) reply = {"status": "ok", "data": data} except: - reply = {"status": "failed"} + reply = {"status": "failed", + "message": traceback.format_exc()} yield from self._send(reply, self.send_timeout) @asyncio.coroutine diff --git a/artiq/management/worker_impl.py b/artiq/management/worker_impl.py index aabee342a..c03dbb673 100644 --- a/artiq/management/worker_impl.py +++ b/artiq/management/worker_impl.py @@ -52,7 +52,7 @@ def make_parent_action(action, argnames, exception=ParentActionError): if reply["status"] == "ok": return reply["data"] else: - raise exception + raise exception(reply["message"]) return parent_action