mirror of https://github.com/m-labs/artiq.git
management/worker: improve error reporting
This commit is contained in:
parent
0bd54921af
commit
893c18679f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue