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 | |
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')
-rw-r--r-- | paste/exceptions/formatter.py | 8 | ||||
-rw-r--r-- | paste/exceptions/reporter.py | 6 |
2 files changed, 8 insertions, 6 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): diff --git a/paste/exceptions/reporter.py b/paste/exceptions/reporter.py index 643a004..c09a7a6 100644 --- a/paste/exceptions/reporter.py +++ b/paste/exceptions/reporter.py @@ -75,9 +75,9 @@ class EmailReporter(Reporter): html_long.set_param('charset', 'UTF-8') msg.attach(html_msg) msg.attach(html_long) - msg['Subject'] = '%s%s: %s' % ( - self.subject_prefix, exc_data.exception_type, - exc_data.exception_value) + subject = '%s: %s' % (exc_data.exception_type, + formatter.truncate(str(exc_data.exception_value))) + msg['Subject'] = self.subject_prefix + subject msg['From'] = self.from_address msg['To'] = ', '.join(self.to_addresses) return msg |