From b4cb0ae4772e2fab08678ce5255295a3ece1f4ac Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 20 Oct 2011 12:42:18 +0200 Subject: [PATCH] [IMP] QWeb2: do not swallow stack trace with try,catch in debug mode bzr revid: fme@openerp.com-20111020104218-q0qe91v99hz8a4yq --- addons/web/static/lib/qweb/qweb2.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 5785ddaaa30..34457ade4fd 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -318,12 +318,14 @@ QWeb2.Engine = (function() { " dict = dict || {};\n" + " dict['__template__'] = '" + template + "';\n" + " var r = [];\n" + - " /* START TEMPLATE */ try {\n" + + " /* START TEMPLATE */" + + (this.debug ? "" : " try {\n") + (e.compile()) + "\n" + - " /* END OF TEMPLATE */ } catch(error) {\n" + + " /* END OF TEMPLATE */" + + (this.debug ? "" : " } catch(error) {\n" + " if (console && console.exception) console.exception(error);\n" + - " context.engine.tools.exception('Runtime Error: ' + error, context);\n" + - " }\n" + + " context.engine.tools.exception('Runtime Error: ' + error, context);\n") + + (this.debug ? "" : " }\n") + " return r.join('');"; }, render : function(template, dict) {