From 88fb9e56b849054771a834a0a4bde3d13f706700 Mon Sep 17 00:00:00 2001 From: "tgoff0@gmail.com" Date: Wed, 21 Jan 2015 21:37:43 +0000 Subject: [PATCH] daemon: Send an exception message reply if an error occurs when importing/executing a file. --- trunk/daemon/sbin/core-daemon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trunk/daemon/sbin/core-daemon b/trunk/daemon/sbin/core-daemon index 68113f7c..258d51f7 100755 --- a/trunk/daemon/sbin/core-daemon +++ b/trunk/daemon/sbin/core-daemon @@ -978,6 +978,12 @@ class CoreRequestHandler(SocketServer.BaseRequestHandler): except Exception, e: self.warn("error executing '%s': %s" % \ (ex, traceback.format_exc())) + tlvdata = coreapi.CoreExceptionTlv.pack( \ + coreapi.CORE_TLV_EXCP_LEVEL, 2) + tlvdata += coreapi.CoreExceptionTlv.pack( \ + coreapi.CORE_TLV_EXCP_TEXT, str(e)) + msg = coreapi.CoreExceptionMessage.pack(0, tlvdata) + replies.append(msg) return replies gui = msg.gettlv(coreapi.CORE_TLV_REG_GUI)