[FIX] components: wrap onWillRender/onRendered hooks instead of renderFn

Previously, we were wrapping the entire renderFn in a try/catch, causing
errors during template execution to be caught and wrapped by
onWillRender/onRendered which is undesirable. Now we only wrap the hook
that's being registered.
This commit is contained in:
Samuel Degueldre
2022-03-08 09:37:39 +01:00
committed by Géry Debongnie
parent 14d2328c88
commit 67f86a4ab8
3 changed files with 67 additions and 6 deletions
@@ -1156,6 +1156,19 @@ exports[`errors and promises errors in mounted and in willUnmount 1`] = `
}"
`;
exports[`errors and promises errors in onWillRender/onRender aren't wrapped more than once 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let block1 = createBlock(\`<div>abc</div>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`errors and promises errors in rerender 1`] = `
"function anonymous(bdom, helpers
) {