summaryrefslogtreecommitdiff
path: root/paste/exceptions
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-08-23 19:11:30 +0000
committerianb <devnull@localhost>2006-08-23 19:11:30 +0000
commit99d395d6b3d7a41f47e532eb2bf90197f92e69f6 (patch)
tree313a1425d2b15dad0f1582ed12824ca6db064232 /paste/exceptions
parent823a63518e5979091cfae393e0c01758c74ef822 (diff)
downloadpaste-99d395d6b3d7a41f47e532eb2bf90197f92e69f6.tar.gz
Fixed a bug in the registry test (not code), since str(registered_object) never fails anymore. Fixed some formatting because of new-style exceptions in Python 2.5
Diffstat (limited to 'paste/exceptions')
-rw-r--r--paste/exceptions/collector.py4
-rw-r--r--paste/exceptions/formatter.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/paste/exceptions/collector.py b/paste/exceptions/collector.py
index 2b454e5..93eee4c 100644
--- a/paste/exceptions/collector.py
+++ b/paste/exceptions/collector.py
@@ -95,7 +95,7 @@ class ExceptionCollector:
``exception_formatted``:
The formatted exception, generally a full traceback
``exception_type``:
- The string type of the exception, like ``'ValueError'``
+ The type of the exception, like ``ValueError``
``exception_value``:
The string value of the exception, like ``'x not in list'``
``identification_code``:
@@ -346,7 +346,7 @@ class ExceptionCollector:
result = CollectedException(
frames=frames,
exception_formatted=self.collectExceptionOnly(etype, value),
- exception_type=str(etype),
+ exception_type=etype,
exception_value=str(value),
identification_code=ident,
date=time.localtime(),
diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py
index 4aa876b..2b51b38 100644
--- a/paste/exceptions/formatter.py
+++ b/paste/exceptions/formatter.py
@@ -75,8 +75,11 @@ class AbstractFormatter(object):
if source:
lines.append(self.format_long_source(
source, long_source))
+ etype = exc_data.exception_type
+ if not isinstance(etype, basestring):
+ etype = etype.__name__
exc_info = self.format_exception_info(
- exc_data.exception_type,
+ etype,
exc_data.exception_value)
data_by_importance = {'important': [], 'normal': [],
'supplemental': [], 'extra': []}