diff --git a/core/dbt/task/run.py b/core/dbt/task/run.py index e0c436b5a61..0900f06c06f 100644 --- a/core/dbt/task/run.py +++ b/core/dbt/task/run.py @@ -94,11 +94,16 @@ def get_execution_status(sql: str, adapter: BaseAdapter) -> Tuple[RunStatus, str response, _ = adapter.execute(sql, auto_begin=False, fetch=False) status = RunStatus.Success message = response._message + except (KeyboardInterrupt, SystemExit): + raise except DbtRuntimeError as exc: status = RunStatus.Error message = exc.msg - finally: - return status, message + except Exception as exc: + status = RunStatus.Error + message = str(exc) + + return (status, message) def _get_adapter_info(adapter, run_model_result) -> Dict[str, Any]: