Skip to content
Snippets Groups Projects
Commit 54a95099 authored by qsm-odoo's avatar qsm-odoo
Browse files

[REF] web: remove custom frontend code since done by crashmanager


The handling of unhandledrejection in the frontend was done with
dedicated code since the crashmanager was not in the frontend. This is
the case now so that dedicated code became useless.

closes odoo/odoo#42927

Signed-off-by: default avatarfja-odoo <fja-odoo@users.noreply.github.com>
parent d165a8ce
No related branches found
No related tags found
No related merge requests found
......@@ -19,19 +19,6 @@ function getLang() {
var lang = utils.get_cookie('frontend_lang') || getLang(); // FIXME the cookie value should maybe be in the ctx?
var localeDef = ajax.loadJS('/web/webclient/locale/' + lang.replace('-', '_'));
// In the frontend, there is no CrashManager instance. Errors are displayed in
// the console. However, we do want to do the same as the backend for Promise
// unhandled rejections.
window.addEventListener('unhandledrejection', function (ev) {
if (!ev.reason || !(ev.reason instanceof Error)) {
// the rejection is not due to an Error, so prevent the browser
// from displaying an 'unhandledrejection' error in the console
ev.stopPropagation();
ev.stopImmediatePropagation();
ev.preventDefault();
}
});
/**
* Element which is designed to be unique and that will be the top-most element
* in the widget hierarchy. So, all other widgets will be indirectly linked to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment