summaryrefslogtreecommitdiff
path: root/paste/exceptions/formatter.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-10-13 02:46:38 +0000
committerianb <devnull@localhost>2006-10-13 02:46:38 +0000
commitf7c6b226edbbe6f7bde870e2ee1d7c241484b450 (patch)
treeb883038edc3880f86327686b315edb649a353a16 /paste/exceptions/formatter.py
parent399e3a446c88ef15e864e77d75e5592ef333c094 (diff)
downloadpaste-f7c6b226edbbe6f7bde870e2ee1d7c241484b450.tar.gz
Fixed a couple problems with error reports that might go over size
Diffstat (limited to 'paste/exceptions/formatter.py')
-rw-r--r--paste/exceptions/formatter.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py
index 1dd592e..907475a 100644
--- a/paste/exceptions/formatter.py
+++ b/paste/exceptions/formatter.py
@@ -222,14 +222,16 @@ class TextFormatter(AbstractFormatter):
v = repr(v)
except Exception, e:
v = 'Cannot display: %s' % e
+ v = truncate(v)
lines.append(' %s: %s' % (n, v))
return '\n'.join(lines)
elif (isinstance(value, (list, tuple))
and self.long_item_list(value)):
- return '%s: [,\n %s]' % (
- title, '\n '.join(map(repr, value)))
+ parts = [truncate(repr(v)) for v in value]
+ return '%s: [\n %s]' % (
+ title, ',\n '.join(parts))
else:
- return '%s: %r' % (title, value)
+ return '%s: %s' % (title, truncate(repr(value)))
class HTMLFormatter(TextFormatter):