mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] component: propagate error to mount and render
This commit is contained in:
committed by
Aaron Bohy
parent
2c563ee380
commit
9cee12d7b4
@@ -53,6 +53,8 @@ export class Fiber {
|
||||
sibling: Fiber | null = null;
|
||||
parent: Fiber | null = null;
|
||||
|
||||
error?: Error;
|
||||
|
||||
constructor(parent: Fiber | null, component: Component<any, any>, props, scope, vars, force) {
|
||||
this.force = force;
|
||||
this.scope = scope;
|
||||
@@ -212,14 +214,15 @@ export class Fiber {
|
||||
root = component;
|
||||
component = component.__owl__.parent!;
|
||||
}
|
||||
console.error(error);
|
||||
qweb.trigger("error", error);
|
||||
|
||||
if (canCatch) {
|
||||
setTimeout(() => {
|
||||
console.error(error);
|
||||
component.catchError!(error);
|
||||
});
|
||||
} else {
|
||||
this.root.error = error;
|
||||
root.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user