Skip to content

Commit

Permalink
save logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dapollak committed Aug 25, 2024
1 parent f4b5e01 commit 55ed51e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion elementary/clients/dbt/api_dbt_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
CommandLineDbtRunner,
DbtCommandResult,
)
from elementary.clients.dbt.dbt_log import DbtLog
from elementary.exceptions.exceptions import DbtCommandError
from elementary.utils.cwd import with_chdir
from elementary.utils.env_vars_context import env_vars_context
Expand Down Expand Up @@ -40,7 +41,7 @@ def _inner_run_command(
dbt_logs = []

def collect_dbt_command_logs(event):
if event.info.name == "JinjaLogInfo":
if event.info.name in ["JinjaLogInfo", "RunningOperationCaughtError"]:
event_dump = json.dumps(MessageToDict(event)) # type: ignore[arg-type]
dbt_logs.append(event_dump)

Expand All @@ -53,6 +54,7 @@ def collect_dbt_command_logs(event):
raise DbtCommandError(
base_command_args=dbt_command_args,
err_msg=(str(res.exception) if res.exception else output),
logs=[DbtLog.from_log_line(log) for log in dbt_logs],
)

return APIDbtCommandResult(success=res.success, output=output, result_obj=res)
Expand Down

0 comments on commit 55ed51e

Please sign in to comment.