XD-DENG commented on a change in pull request #4783: [AIRFLOW-578] Fix check 
return code 
URL: https://github.com/apache/airflow/pull/4783#discussion_r260572424
 
 

 ##########
 File path: airflow/jobs.py
 ##########
 @@ -203,16 +210,19 @@ def run(self):
             make_transient(self)
             self.id = id_
 
+            # Run
             try:
                 self._execute()
                 # In case of max runs or max duration
                 self.state = State.SUCCESS
             except SystemExit:
                 # In case of ^C or SIGTERM
                 self.state = State.SUCCESS
-            except Exception:
+            except Exception as e:
                 self.state = State.FAILED
-                raise
+                self.log.error("Job finished with an exception")
+                self.log.exception(e)
+                self.on_failure(e)
 
 Review comment:
   why not directly call `raise e` here? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to