summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-12-06 08:58:04 +0000
committerXavier Morel <xmo@odoo.com>2020-01-21 06:56:14 +0000
commitf9c8a7e7d8347b8f217da5c4f3ef05fbf1948ba4 (patch)
treee99985941d5d9951320ce9e4a096311001660746 /addons/web/static/src
parentaa95b622c3bac070feeb2107094bf95913143ee5 (diff)
[FIX] web: client-side RPC error to have an arguments data member
Several XHR error handlers expect a data.arguments member which holds the args tuple from the Python exception. Some have alternate codepaths for "xhr errors" but several don't (e.g. addons/payment/static/src/js/payment_form.js:142, addons/web/static/src/js/services/crash_manager.js:229, addons/website/static/src/js/content/website_root.js:167) and will thus blow up on synthetic client-side xhr errors. Modify the synthetic errors so they provide that member as an array.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/core/ajax.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/ajax.js b/addons/web/static/src/js/core/ajax.js
index bc5250ab620..cf5fe87b2ae 100644
--- a/addons/web/static/src/js/core/ajax.js
+++ b/addons/web/static/src/js/core/ajax.js
@@ -87,7 +87,8 @@ function _genericJsonRpc (fct_name, params, settings, fct) {
data: {
type: "xhr"+textStatus,
debug: error.responseText,
- objects: [error, errorThrown]
+ objects: [error, errorThrown],
+ arguments: [reason || textStatus]
},
};
reject({message: nerror, event: $.Event()});