From 8c456d280cafc3db609176f39761231e40778b33 Mon Sep 17 00:00:00 2001 From: equinox Date: Tue, 27 Sep 2011 02:10:21 +0200 Subject: python: get exception page on template bug --- tmpl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1