Skip to content

Commit

Permalink
[FIX] web: restore proper public widgets onFailure in old guardedCatch
Browse files Browse the repository at this point in the history
Commit [1] made a mistake when adapting the guardedCatch handler.

[1]: odoo@fcb16a3

closes odoo#163486

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
  • Loading branch information
qsm-odoo committed Apr 26, 2024
1 parent 27ef7d5 commit 16de0f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/web/static/src/legacy/js/public/public_root.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ export const PublicRoot = publicWidget.RootWidget.extend({
this._startWidgets(ev.data.$target, ev.data.options)
.then(ev.data.onSuccess)
.catch((e) => {
ev.data.onFailure(e);
if (ev.data.onFailure) {
ev.data.onFailure(e);
}
if (!(e instanceof RPCError)) {
return Promise.reject(e);
}
Expand Down

0 comments on commit 16de0f7

Please sign in to comment.