diff --git a/airflow/executors/local_executor.py b/airflow/executors/local_executor.py index 775b6ca651053..fc662fcd59320 100644 --- a/airflow/executors/local_executor.py +++ b/airflow/executors/local_executor.py @@ -125,12 +125,12 @@ def _execute_work_in_fork(self, command: CommandType) -> str: ret = 0 return State.SUCCESS except Exception as e: - self.log.error("Failed to execute task %s.", str(e)) + self.log.exception("Failed to execute task %s.", e) + return State.FAILED finally: Sentry.flush() logging.shutdown() os._exit(ret) - raise RuntimeError('unreachable -- keep mypy happy') @abstractmethod def do_work(self):