diff --git a/elementary/clients/dbt/api_dbt_runner.py b/elementary/clients/dbt/api_dbt_runner.py index 7f7407f4b..a30b6ba57 100644 --- a/elementary/clients/dbt/api_dbt_runner.py +++ b/elementary/clients/dbt/api_dbt_runner.py @@ -50,7 +50,10 @@ def collect_dbt_command_logs(event): res: dbtRunnerResult = dbt.invoke(dbt_command_args) output = "\n".join(dbt_logs) or None if self.raise_on_failure and not res.success: - raise DbtCommandError(base_command_args=dbt_command_args, err_msg=output) + raise DbtCommandError( + base_command_args=dbt_command_args, + err_msg=(str(res.exception) if res.exception else output), + ) return APIDbtCommandResult(success=res.success, output=output, result_obj=res)