From 38f463af32570ca5bc6d3d43d4130ae47b4fe8e2 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Mon, 13 Mar 2023 11:11:59 +0000 Subject: [PATCH] [FIX] web: restore error dialogs for erroring js modules In 64fc704527105afc8f06cafe8428e5c30c3ee097, we made it so that when an async module throws an error, we catch the error and log it so that we can mark the module as being in error. This means the error is now invisible to the error service. We do not want to rethrow the error, as this would stop us from loading the rest of the modules, but we can still allow the error service to see the error by simply dispatching it as a promise rejection in a separate async call stack, allowing us to continue loading modules but also giving the opportunity to the error service to see the error if it is started. Closes #92192 closes odoo/odoo#115230 X-original-commit: facc0f0c022df94487ef9518348f039b56c7b536 Signed-off-by: Samuel Degueldre --- addons/web/static/src/boot.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/boot.js b/addons/web/static/src/boot.js index 55c2d96a098..2b5e13266e1 100644 --- a/addons/web/static/src/boot.js +++ b/addons/web/static/src/boot.js @@ -104,6 +104,7 @@ job.error = e; failed.push(job); console.error(`Error while loading ${job.name}: ${e.message}`, e); + Promise.reject(e); } var def = new Promise(function (resolve) { try {