diff options
Diffstat (limited to 'tmpl.py')
-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 |