daemon: Send an exception message reply if an error occurs when

importing/executing a file.
This commit is contained in:
tgoff0 2015-01-21 21:37:43 +00:00
parent b9ebcd979c
commit 29c31aad9a

View file

@ -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)