daemon: Send an exception message reply if an error occurs when
importing/executing a file.
This commit is contained in:
parent
b9ebcd979c
commit
29c31aad9a
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue