uranusjr commented on a change in pull request #17967:
URL: https://github.com/apache/airflow/pull/17967#discussion_r700772484
##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
try:
args.func(args, dag=self.dag)
return_code = 0
- except Exception:
+ except Exception as task_launch_exception:
+ self.log.error(repr(task_launch_exception))
Review comment:
I’d want this to be
```python
self.log.exception("some human-readable description about the situation")
```
The `.exception` call automatically includes information of the caught
exception so you don’t need to render the exception manually.
##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -84,7 +84,8 @@ def _start_by_fork(self):
try:
args.func(args, dag=self.dag)
return_code = 0
- except Exception:
+ except Exception as task_launch_exception:
+ self.log.error(repr(task_launch_exception))
Review comment:
I’d want this to be
```python
self.log.exception("some human-readable description about the situation")
```
The `.exception` call automatically includes information of the caught
exception so you don’t need to render the exception manually.
https://docs.python.org/3/library/logging.html#logging.exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]