Commit 6178f251 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert commit 19169.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19193 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 82692fc0
...@@ -358,9 +358,8 @@ class SQLDict(RAMDict, SQLBase): ...@@ -358,9 +358,8 @@ class SQLDict(RAMDict, SQLBase):
# Whatever happens, duplicate uids are to be made available. Only # Whatever happens, duplicate uids are to be made available. Only
# executed message will get to lower priority or error state. # executed message will get to lower priority or error state.
make_available_uid_list.extend(uid_to_duplicate_uid_list_dict.get(uid, [])) make_available_uid_list.extend(uid_to_duplicate_uid_list_dict.get(uid, []))
exc_type = m.exc_info[0] if type(m.exc_type) is ClassType and \
if type(exc_type) is ClassType and \ issubclass(m.exc_type, ConflictError):
issubclass(exc_type, ConflictError):
delay_uid_list.append(uid) delay_uid_list.append(uid)
elif priority > MAX_PRIORITY: elif priority > MAX_PRIORITY:
notify_user_list.append(m) notify_user_list.append(m)
......
...@@ -198,9 +198,8 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -198,9 +198,8 @@ class SQLQueue(RAMQueue, SQLBase):
if m.active_process: if m.active_process:
message_with_active_process_list.append(m) message_with_active_process_list.append(m)
else: else:
exc_type = m.exc_info[0] if type(m.exc_type) is ClassType and \
if type(exc_type) is ClassType and \ issubclass(m.exc_type, ConflictError):
issubclass(exc_type, ConflictError):
delay_uid_list.append(uid) delay_uid_list.append(uid)
elif priority > MAX_PRIORITY: elif priority > MAX_PRIORITY:
notify_user_list.append(m) notify_user_list.append(m)
......
...@@ -115,7 +115,9 @@ class Message: ...@@ -115,7 +115,9 @@ class Message:
self.args = args self.args = args
self.kw = kw self.kw = kw
self.is_executed = 0 self.is_executed = 0
self.exc_info = (None, None, None) self.exc_type = None
self.exc_value = None
self.traceback = None
self.processing = None self.processing = None
self.user_name = str(_getAuthenticatedUser(self)) self.user_name = str(_getAuthenticatedUser(self))
# Store REQUEST Info ? # Store REQUEST Info ?
...@@ -197,13 +199,16 @@ class Message: ...@@ -197,13 +199,16 @@ class Message:
self.is_executed = 1 self.is_executed = 1
except: except:
self.is_executed = 0 self.is_executed = 0
self.exc_info = sys.exc_info() self.exc_type = sys.exc_info()[0]
self.exc_value = str(sys.exc_info()[1])
self.traceback = ''.join(ExceptionFormatter.format_exception(
*sys.exc_info()))
LOG('ActivityTool', WARNING, LOG('ActivityTool', WARNING,
'Could not call method %s on object %s' % ( 'Could not call method %s on object %s' % (
self.method_id, self.object_path), error=self.exc_info) self.method_id, self.object_path), error=sys.exc_info())
# push the error in ZODB error_log # push the error in ZODB error_log
if getattr(activity_tool, 'error_log', None) is not None: if getattr(activity_tool, 'error_log', None) is not None:
activity_tool.error_log.raising(self.exc_info) activity_tool.error_log.raising(sys.exc_info())
def validate(self, activity, activity_tool, check_order_validation=1): def validate(self, activity, activity_tool, check_order_validation=1):
return activity.validate(activity_tool, self, return activity.validate(activity_tool, self,
...@@ -231,17 +236,16 @@ Subject: %s ...@@ -231,17 +236,16 @@ Subject: %s
Document: %s Document: %s
Method: %s Method: %s
Exception: %s %s
%s %s
""" % (activity_tool.email_from_address, user_email, message, """ % (activity_tool.email_from_address, user_email, message,
message, '/'.join(self.object_path), self.method_id, message, '/'.join(self.object_path), self.method_id,
''.join(ExceptionFormatter.format_exception(*self.exc_info))) self.exc_type, self.exc_value, self.traceback)
try: try:
activity_tool.MailHost.send( mail_text ) activity_tool.MailHost.send( mail_text )
except (socket.error, MailHostError): except (socket.error, MailHostError), message:
LOG('ActivityTool.notifyUser', WARNING, 'Mail containing failure information failed to be sent.', error=sys.exc_info()) LOG('ActivityTool.notifyUser', WARNING, 'Mail containing failure information failed to be sent: %s. Exception was: %s %s\n%s' % (message, self.exc_type, self.exc_value, self.traceback))
if self.exc_info[0] is not None:
LOG('ActivityTool.notifyUser', WARNING, 'Original exception', error=self.exc_info)
def reactivate(self, activity_tool): def reactivate(self, activity_tool):
# Reactivate the original object. # Reactivate the original object.
...@@ -840,10 +844,10 @@ class ActivityTool (Folder, UniqueObject): ...@@ -840,10 +844,10 @@ class ActivityTool (Folder, UniqueObject):
new_message_list.append(m) new_message_list.append(m)
except: except:
m.is_executed = 0 m.is_executed = 0
m.exc_info = sys.exc_info() m.exc_type = sys.exc_info()[0]
LOG('WARNING ActivityTool', 0, LOG('WARNING ActivityTool', 0,
'Could not call method %s on object %s' % 'Could not call method %s on object %s' %
(m.method_id, m.object_path), error=m.exc_info) (m.method_id, m.object_path), error=sys.exc_info())
try: try:
if len(expanded_object_list) > 0: if len(expanded_object_list) > 0:
...@@ -858,10 +862,10 @@ class ActivityTool (Folder, UniqueObject): ...@@ -858,10 +862,10 @@ class ActivityTool (Folder, UniqueObject):
# In this case, the group method completely failed. # In this case, the group method completely failed.
for m in new_message_list: for m in new_message_list:
m.is_executed = 0 m.is_executed = 0
m.exc_info = sys.exc_info() m.exc_type = sys.exc_info()[0]
LOG('WARNING ActivityTool', 0, LOG('WARNING ActivityTool', 0,
'Could not call method %s on objects %s' % 'Could not call method %s on objects %s' %
(method_id, expanded_object_list), error=m.exc_info) (method_id, expanded_object_list), error=sys.exc_info())
else: else:
# Obtain all indices of failed messages. Note that this can be a partial failure. # Obtain all indices of failed messages. Note that this can be a partial failure.
failed_message_dict = {} failed_message_dict = {}
...@@ -885,10 +889,10 @@ class ActivityTool (Folder, UniqueObject): ...@@ -885,10 +889,10 @@ class ActivityTool (Folder, UniqueObject):
m.is_executed = 1 m.is_executed = 1
except: except:
m.is_executed = 0 m.is_executed = 0
m.exc_info = sys.exc_info() m.exc_type = sys.exc_info()[0]
LOG('ActivityTool', WARNING, LOG('ActivityTool', WARNING,
'Could not call method %s on object %s' % ( 'Could not call method %s on object %s' % (
m.method_id, m.object_path), error=m.exc_info) m.method_id, m.object_path), error=sys.exc_info())
def newMessage(self, activity, path, active_process, def newMessage(self, activity, path, active_process,
activity_kw, method_id, *args, **kw): activity_kw, method_id, *args, **kw):
......
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