[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user