diff options
| author | Xavier Morel <xmo@odoo.com> | 2015-09-14 10:10:11 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2015-09-14 10:20:30 +0200 |
| commit | 9882c8826edcf2f36608a18fc7c85f89da856837 (patch) | |
| tree | 89b5fd0d0b2bed23137fde250cc0a1fc98b7e346 /addons/web/static/src/js/framework | |
| parent | 330bf5ec2faf3a9aa063772eb27c9f10a67465e1 (diff) | |
[IMP] web: improve Widget.proxy's error reporting
Provide a more informative error message than "undefined is not a
function" when a method passed by name to the events object is missing
on the widget.
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/widget.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/framework/widget.js b/addons/web/static/src/js/framework/widget.js index 3a90e432000..a6b189dc832 100644 --- a/addons/web/static/src/js/framework/widget.js +++ b/addons/web/static/src/js/framework/widget.js @@ -392,6 +392,9 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, { var self = this; return function () { var fn = (typeof method === 'string') ? self[method] : method; + if (fn === void 0) { + throw new Error("Couldn't find method '" + method + "' in widget " + self); + } return fn.apply(self, arguments); }; }, |
