From 47dc9f4767a138b7609c0987fc02191424aa59be Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Sun, 1 Dec 2024 09:14:06 -0500 Subject: [PATCH] catch generic exception in catch_jinja and reraise as CompilationError --- dbt_common/clients/jinja.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt_common/clients/jinja.py b/dbt_common/clients/jinja.py index 2cee922..cb136a3 100644 --- a/dbt_common/clients/jinja.py +++ b/dbt_common/clients/jinja.py @@ -534,6 +534,8 @@ def catch_jinja(node: Optional[_NodeProtocol] = None) -> Iterator[None]: except CompilationError as exc: exc.add_node(node) raise + except Exception as e: + raise CompilationError(str(e), node) from e _TESTING_PARSE_CACHE: Dict[str, jinja2.nodes.Template] = {}