[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.
This commit is contained in:
Xavier Morel
2020-01-21 06:56:14 +00:00
parent aa95b622c3
commit f9c8a7e7d8
+2 -1
View File
@@ -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()});