diff options
author | ianb <devnull@localhost> | 2006-02-21 00:52:01 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-02-21 00:52:01 +0000 |
commit | f6fb5e8087394ebca58239111391b3340bfb6317 (patch) | |
tree | c3222500ec859d48d107aba86fd1248b8e56326f /paste/evalexception | |
parent | a578cfd1e095b30584e7d61c1c4beec9e66589fe (diff) | |
download | paste-f6fb5e8087394ebca58239111391b3340bfb6317.tar.gz |
Catch errors in pprinting values
Diffstat (limited to 'paste/evalexception')
-rw-r--r-- | paste/evalexception/middleware.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py index 4576e10..f3b4c7a 100644 --- a/paste/evalexception/middleware.py +++ b/paste/evalexception/middleware.py @@ -380,7 +380,10 @@ def make_table(items): for name, value in items: i += 1 out = StringIO() - pprint.pprint(value, out) + try: + pprint.pprint(value, out) + except Exception, e: + print >> out, 'Error: %s' % e value = html_quote(out.getvalue()) if len(value) > 100: # @@: This can actually break the HTML :( |