From 1d84ead6642122a410dcae29187ab051b9c8b0de Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Thu, 6 May 2010 08:42:36 +0000 Subject: [PATCH] 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 --- product/CMFActivity/ActivityTool.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/product/CMFActivity/ActivityTool.py b/product/CMFActivity/ActivityTool.py index 0d6e67677f..d17dd0f106 100644 --- a/product/CMFActivity/ActivityTool.py +++ b/product/CMFActivity/ActivityTool.py @@ -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: -- 2.30.9