[Erp5-report] r24077 - in /erp5/trunk/products/CMFActivity/Activity: SQLDict.py SQLQueue.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 7 18:40:25 CEST 2008


Author: vincent
Date: Tue Oct  7 18:40:25 2008
New Revision: 24077

URL: http://svn.erp5.org?rev=24077&view=rev
Log:
Store exception information on message in the case where commit fails, removing a possible cause for error messages with no error text.

Modified:
    erp5/trunk/products/CMFActivity/Activity/SQLDict.py
    erp5/trunk/products/CMFActivity/Activity/SQLQueue.py

Modified: erp5/trunk/products/CMFActivity/Activity/SQLDict.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLDict.py?rev=24077&r1=24076&r2=24077&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLDict.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLDict.py Tue Oct  7 18:40:25 2008
@@ -38,6 +38,7 @@
 #from time import time
 from SQLBase import SQLBase
 from Products.CMFActivity.ActivityRuntimeEnvironment import setActivityRuntimeValue, updateActivityRuntimeValue, clearActivityRuntimeEnvironment
+from zExceptions import ExceptionFormatter
 
 try:
   from transaction import get as get_transaction
@@ -491,8 +492,16 @@
           except:
             LOG('SQLDict', PANIC, 'Failed to abort executed messages which also failed to commit. Some objects may be modified accidentally.')
             raise
+        exc_info = sys.exc_info()
+        exc_type = exc_info[0]
+        exc_value = str(exc_info[1])
+        traceback = ''.join(ExceptionFormatter.format_exception(
+                            *exc_info))
         for x in message_uid_priority_list:
           x[1].is_executed = MESSAGE_NOT_EXECUTED
+          x[1].exc_type = exc_type
+          x[1].exc_value = exc_value
+          x[1].traceback = traceback
         failed_message_uid_list = [x[0] for x in message_uid_priority_list]
         try:
           makeMessageListAvailable(failed_message_uid_list, uid_to_duplicate_uid_list_dict)

Modified: erp5/trunk/products/CMFActivity/Activity/SQLQueue.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLQueue.py?rev=24077&r1=24076&r2=24077&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLQueue.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLQueue.py Tue Oct  7 18:40:25 2008
@@ -39,6 +39,7 @@
 from sets import ImmutableSet
 from SQLBase import SQLBase
 from Products.CMFActivity.ActivityRuntimeEnvironment import setActivityRuntimeValue, updateActivityRuntimeValue, clearActivityRuntimeEnvironment
+from zExceptions import ExceptionFormatter
 
 try:
   from transaction import get as get_transaction
@@ -320,6 +321,11 @@
           # It is possible that the message is executed but the commit
           # of the transaction fails
           value[1].is_executed = MESSAGE_NOT_EXECUTED
+          exc_info = sys.exc_info()
+          value[1].exc_type = exc_info[0]
+          value[1].exc_value = str(exc_info[1])
+          value[1].traceback = ''.join(ExceptionFormatter.format_exception(
+                                       *exc_info))
           try:
             makeMessageListAvailable([value[0]])
           except:




More information about the Erp5-report mailing list