Merge pull request #954 from pdvyas/jinja-error
Show a better error message in case of jinja syntax error
This commit is contained in:
commit
758bb69296
1 changed files with 2 additions and 1 deletions
|
|
@ -20,7 +20,8 @@ class PrintFormat(Document):
|
|||
jenv = frappe.get_jenv()
|
||||
try:
|
||||
jenv.from_string(self.html)
|
||||
except TemplateSyntaxError:
|
||||
except TemplateSyntaxError, e:
|
||||
frappe.msgprint('Line {}: {}'.format(e.lineno, e.message))
|
||||
frappe.throw(frappe._("Syntax error in Jinja template"))
|
||||
|
||||
def on_update(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue