From 29c31aad9a4bdd37c52497d6e07cfac3289084c8 Mon Sep 17 00:00:00 2001 From: tgoff0 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. --- daemon/sbin/core-daemon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/sbin/core-daemon b/daemon/sbin/core-daemon index 68113f7c..258d51f7 100755 --- a/daemon/sbin/core-daemon +++ b/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)