[IMP] component: propagate error to mount and render

This commit is contained in:
Géry Debongnie
2019-10-26 16:44:12 +02:00
committed by Aaron Bohy
parent 2c563ee380
commit 9cee12d7b4
4 changed files with 127 additions and 31 deletions
+4 -1
View File
@@ -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();
}
}