##// END OF EJS Templates
Handle string exceptions.
Gael Varoquaux -
Show More
@@ -15,6 +15,7 b' __docformat__ = "restructuredtext en"'
15 15 # Imports
16 16 #-------------------------------------------------------------------------------
17 17 import sys
18 from traceback import format_list
18 19
19 20 class TracebackTrap(object):
20 21 """ Object to trap and format tracebacks.
@@ -73,8 +74,12 b' class TracebackTrap(object):'
73 74
74 75 # Go through the list of formatters and let them add their formatting.
75 76 traceback = {}
77 try:
76 78 for formatter in self.formatters:
77 79 traceback[formatter.identifier] = formatter(*self.args)
80 except:
81 # This works always, including with string exceptions.
82 traceback['fallback'] = repr(self.args)
78 83
79 84 message['traceback'] = traceback
80 85
General Comments 0
You need to be logged in to leave comments. Login now