diff options
| author | ianb <devnull@localhost> | 2006-10-13 02:46:38 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2006-10-13 02:46:38 +0000 |
| commit | f7c6b226edbbe6f7bde870e2ee1d7c241484b450 (patch) | |
| tree | b883038edc3880f86327686b315edb649a353a16 /paste/exceptions/formatter.py | |
| parent | 399e3a446c88ef15e864e77d75e5592ef333c094 (diff) | |
| download | paste-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.py | 8 |
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): |
