Improved Jinja's debugging support by introducing "@internalcode" which marks code objects that are skipped on tracebacks. Also template errors are now translated as well to help the pylons debugger.
--HG--
branch : trunk
diff --git a/jinja2/exceptions.py b/jinja2/exceptions.py
index 8311cf3..182c061 100644
--- a/jinja2/exceptions.py
+++ b/jinja2/exceptions.py
@@ -44,7 +44,16 @@
self.filename = filename
self.source = None
+ # this is set to True if the debug.translate_syntax_error
+ # function translated the syntax error into a new traceback
+ self.translated = False
+
def __unicode__(self):
+ # for translated errors we only return the message
+ if self.translated:
+ return self.message.encode('utf-8')
+
+ # otherwise attach some stuff
location = 'line %d' % self.lineno
name = self.filename or self.name
if name: