Commit 1d84ead6 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Emit a log message at every point where the Acitivity Tool might mark a...

Emit a log message at every point where the Acitivity Tool might mark a message as MESSAGE_NOT_EXECUTABLE, as it seems to be happening even when re-invoking the same message may succeed, and this makes the debugging much easier. This should not degrade the performance significantly, because this kind of errors must be quite rare, as long as the the program is well written.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35043 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 534cd333
No related merge requests found
......@@ -273,6 +273,10 @@ class Message(BaseMessage):
try:
obj = self.getObject(activity_tool)
except KeyError:
LOG('CMFActivity', ERROR,
'Message failed in getting an object from the path %r' % \
(self.object_path,),
error=sys.exc_info())
self.setExecutionState(MESSAGE_NOT_EXECUTABLE, context=activity_tool)
else:
try:
......@@ -286,6 +290,10 @@ class Message(BaseMessage):
# that method !
method = getattr(obj, self.method_id)
except:
LOG('CMFActivity', ERROR,
'Message failed in getting a method %r from an object %r' % \
(self.method_id, obj,),
error=sys.exc_info())
method = None
self.setExecutionState(MESSAGE_NOT_EXECUTABLE, context=activity_tool)
else:
......@@ -1180,6 +1188,10 @@ class ActivityTool (Folder, UniqueObject):
try:
obj = m.getObject(self)
except KeyError:
LOG('CMFActivity', ERROR,
'Message failed in getting an object from the path %r' % \
(m.object_path,),
error=sys.exc_info())
m.setExecutionState(MESSAGE_NOT_EXECUTABLE, context=self)
continue
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment