summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorequinox <equinox@diac24.net>2011-09-27 02:10:21 +0200
committerequinox <equinox@diac24.net>2011-09-27 02:10:21 +0200
commit8c456d280cafc3db609176f39761231e40778b33 (patch)
tree691af72be9669438e5b913a642c838c4eec07204
parent8d2b75d61631e0794d436eefefb25644de1d2de4 (diff)
python: get exception page on template bug
-rw-r--r--tmpl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tmpl.py b/tmpl.py
index 6551728..9748f2a 100644
--- a/tmpl.py
+++ b/tmpl.py
@@ -40,7 +40,10 @@ def expose(filename, method='html', encoding='utf-8', **options):
stream = exc(e)
if not isinstance(stream, Stream):
return stream
- return encode(serializer(stream), method = serializer, encoding = encoding)
+ try:
+ return encode(serializer(stream), method = serializer, encoding = encoding)
+ except Exception, e:
+ return encode(serializer(exc(e)), method = serializer, encoding = encoding)
return wrapper
return decorate