mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component, fiber: error_handling at the Fiber level
Before this commit, errors triggered at the level of the fiber (as opposed to at the level of a component's rendering), were handled as the very top level of the rendering, that is, in the scheduler. This was wrong because components below in the rendering tree would not have a chance to handle their children's or their own errors. After this commit, error triggered in willPatch, onMounted and onPatched are correctly handled at the closest component to where they were thrown.
This commit is contained in:
committed by
Aaron Bohy
parent
cb107cef7d
commit
ed3e6dcbb6
@@ -1,5 +1,5 @@
|
||||
import { Fiber, RootFiber } from "./fibers";
|
||||
import { handleError, fibersInError } from "./error_handling";
|
||||
import { fibersInError } from "./error_handling";
|
||||
import { STATUS } from "./status";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -60,13 +60,8 @@ export class Scheduler {
|
||||
|
||||
if (fiber.counter === 0) {
|
||||
if (!hasError) {
|
||||
try {
|
||||
fiber.complete();
|
||||
fiber.resolve();
|
||||
} catch (e) {
|
||||
handleError(fiber.node, e);
|
||||
fiber.reject(e);
|
||||
}
|
||||
fiber.complete();
|
||||
fiber.resolve();
|
||||
}
|
||||
this.tasks.delete(fiber);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user