Skip to content

Commit

Permalink
Propagate dbt exception raised during jinja compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Dec 2, 2024
1 parent 7de435b commit 6109ef3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dbt_common/clients/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
MaterializationArgError,
JinjaRenderingError,
UndefinedCompilationError,
DbtRuntimeError,
)
from dbt_common.exceptions.macros import MacroReturn, UndefinedMacroError, CaughtMacroError

Expand Down Expand Up @@ -534,7 +535,11 @@ def catch_jinja(node: Optional[_NodeProtocol] = None) -> Iterator[None]:
except CompilationError as exc:
exc.add_node(node)
raise
except DbtRuntimeError:
# Propagate dbt exception raised during jinja compilation
raise
except Exception as e:
# Raise any non-dbt exceptions as CompilationError
raise CompilationError(str(e), node) from e


Expand Down

0 comments on commit 6109ef3

Please sign in to comment.