[FIX] component: error_handling when an error is rethrown

This commit is contained in:
Lucas Perais (lpe)
2021-12-20 16:27:09 +01:00
committed by Aaron Bohy
parent bf9cceb56f
commit cc1eea0945
3 changed files with 148 additions and 4 deletions
+3 -4
View File
@@ -16,10 +16,6 @@ function _handleError(node: ComponentNode | null, error: any, isFirstRound = fal
const errorHandlers = nodeErrorHandlers.get(node);
if (errorHandlers) {
if (isFirstRound && fiber) {
fiber.root.counter--;
}
let stopped = false;
// execute in the opposite order
for (let i = errorHandlers.length - 1; i >= 0; i--) {
@@ -33,6 +29,9 @@ function _handleError(node: ComponentNode | null, error: any, isFirstRound = fal
}
if (stopped) {
if (isFirstRound && fiber) {
fiber.root.counter--;
}
return true;
}
}