mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] lifecyle_hooks: correctly wrap errors in async code
Before this commit, wrapping an error occurring in async code would result in an unhandledpromise exception, because we created another promise, that would be rejected and that we didn't catch.
This commit is contained in:
committed by
Géry Debongnie
parent
d1118455aa
commit
30bc605c84
@@ -1257,6 +1257,19 @@ exports[`errors and promises an error in willPatch call will reject the render p
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`errors and promises error type is kept when it is wrapped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`errors and promises errors in mounted and in willUnmount 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
@@ -1296,3 +1309,16 @@ exports[`errors and promises errors in rerender 1`] = `
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`errors and promises wrapped errors in async code are correctly caught 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user