diff options
author | equinox <equinox@diac24.net> | 2011-09-27 02:10:21 +0200 |
---|---|---|
committer | equinox <equinox@diac24.net> | 2011-09-27 02:10:21 +0200 |
commit | 8c456d280cafc3db609176f39761231e40778b33 (patch) | |
tree | 691af72be9669438e5b913a642c838c4eec07204 | |
parent | 8d2b75d61631e0794d436eefefb25644de1d2de4 (diff) |
python: get exception page on template bug
-rw-r--r-- | tmpl.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |