mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] *: use a custom error class for all errors thrown by owl
This commit makes all errors thrown in owl use a custom error class. The main point of this is to always wrap user-code errors that happen during the owl lifecycle so that they can be treated uniformly in onError by checking the cause property, and also allows user code to differenciate owl errors from non-owl errors reliably at runtime.
This commit is contained in:
committed by
Géry Debongnie
parent
30bc605c84
commit
7786077921
+2
-1
@@ -19,6 +19,7 @@ import { helpers } from "../src/runtime/template_helpers";
|
||||
import { TemplateSet, globalTemplates } from "../src/runtime/template_set";
|
||||
import { BDom } from "../src/runtime/blockdom";
|
||||
import { compile } from "../src/compiler";
|
||||
import { OwlError } from "../src/runtime/error_handling";
|
||||
|
||||
const mount = blockDom.mount;
|
||||
|
||||
@@ -221,7 +222,7 @@ export async function editInput(input: HTMLInputElement | HTMLTextAreaElement, v
|
||||
afterEach(() => {
|
||||
if (steps.length) {
|
||||
steps.splice(0);
|
||||
throw new Error("Remaining steps! Should be checked by a .toBeLogged() assertion!");
|
||||
throw new OwlError("Remaining steps! Should be checked by a .toBeLogged() assertion!");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user