ashb commented on code in PR #56350:
URL: https://github.com/apache/airflow/pull/56350#discussion_r2402307246


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/triggers/data_factory.py:
##########
@@ -229,14 +229,16 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     }
                 )
         except Exception as e:
+            self.log.exception(e)
             if self.run_id:
                 try:
+                    self.log.info("Cancelling pipeline run %s", self.run_id)
                     await hook.cancel_pipeline_run(
                         run_id=self.run_id,
                         resource_group_name=self.resource_group_name,
                         factory_name=self.factory_name,
                     )
-                    self.log.info("Unexpected error %s caught. Cancel pipeline 
run %s", e, self.run_id)
                 except Exception as err:
-                    yield TriggerEvent({"status": "error", "message": 
str(err), "run_id": self.run_id})
+                    self.log.error("Failed to cancel pipeline run %s", 
self.run_id)
+                    self.log.exception(err)

Review Comment:
   ```suggestion
                       self.log.exception("Failed to cancel pipeline run %s", 
self.run_id)
   ```
   
   `log.exeception` will already include the information from the current 
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]

Reply via email to