diff -r 740402e61479 roundup/hyperdb.py --- a/roundup/hyperdb.py Tue May 21 12:53:20 2013 -0700 +++ b/roundup/hyperdb.py Mon Dec 16 10:28:56 2013 -0800 @@ -21,13 +21,23 @@ __docformat__ = 'restructuredtext' # standard python modules -import os, re, shutil, weakref +import os, re, shutil, sys, weakref +import logging +import traceback +import inspect # roundup modules +import roundup.cgi.cgitb import date, password from support import ensureParentsExist, PrioList, sorted, reversed from roundup.i18n import _ +error_message = """An error has occurred +

An error has occurred

+

A problem was encountered processing your request. +The tracker maintainers have been notified of the problem.

+""" + # # Types # @@ -1260,7 +1270,23 @@ def fireReactors(self, event, nodeid, oldvalues): """Fire all registered reactors""" for prio, name, react in self.reactors[event]: - react(self.db, self, nodeid, oldvalues) + try: + react(self.db, self, nodeid, oldvalues) + except Exception as e: + tb = traceback.format_exc() + client = inspect.stack()[2][0].f_locals['self'].client + html = ("

Traceback

" + + roundup.cgi.cgitb.html(i18n=client.translator) + + ("

Environment Variables

%s
" + % roundup.cgi.cgitb.niceDict("", client.env))) + txt = 'Caught exception %s: %s\n%s' % (str(type(e)), e, tb) + if not client.instance.config.WEB_DEBUG: + exc_info = sys.exc_info() + subject = "Error: %s" % exc_info[1] + client.send_error_to_admin(subject, html, txt) + client.write_html(client._(error_message)) + else: + client.write_html(html) # # import / export support