[FIX] qweb: correctly display qweb error message
When compiling the qweb template, if an error occurs, an error message is displayed with the corresponding failed node. This messsage was not always correct because the node is modified in place during the compilation proccess. The template is now re-read before displaying the error.
This commit is contained in:
@@ -329,6 +329,7 @@ class QWeb(object):
|
||||
raise e
|
||||
except Exception as e:
|
||||
path = _options['last_path_node']
|
||||
element, document = self.get_template(template, options)
|
||||
node = element.getroottree().xpath(path)
|
||||
raise QWebException("Error when compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user