[IMP] web_tour: fail step when custom run() function fails

This commit makes failing custom `run()` functions logged as a failed
tour step.

task-2687506

X-original-commit: bcd679f1d204a8c3f858aa03a992686545829e4b
Part-of: odoo/odoo#101119
This commit is contained in:
Benoit Socias
2022-09-26 14:43:14 +02:00
parent ad86588bfd
commit 216295eaf1
@@ -530,7 +530,12 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
var tour = self.tours[tour_name];
if (typeof tip.run === "function") {
tip.run.call(tip.widget, action_helper);
try {
tip.run.call(tip.widget, action_helper);
} catch (e) {
console.error(`Tour ${tour_name} failed at step ${self._describeTip(tip)}: ${e.message}`);
throw e;
}
} else if (tip.run !== undefined) {
var m = tip.run.match(/^([a-zA-Z0-9_]+) *(?:\(? *(.+?) *\)?)?$/);
try {