guan404ming commented on code in PR #50487:
URL: https://github.com/apache/airflow/pull/50487#discussion_r2085047153


##########
providers/standard/src/airflow/providers/standard/sensors/external_task.py:
##########
@@ -455,23 +461,25 @@ def _check_for_existence(self, session) -> None:
         dag_to_wait = DagModel.get_current(self.external_dag_id, session)
 
         if not dag_to_wait:
-            raise AirflowException(f"The external DAG {self.external_dag_id} 
does not exist.")
+            raise AirflowExternalTaskSensorException(
+                f"The external DAG {self.external_dag_id} does not exist."
+            )
 
         if not os.path.exists(correct_maybe_zipped(dag_to_wait.fileloc)):
-            raise AirflowException(f"The external DAG {self.external_dag_id} 
was deleted.")
+            raise AirflowExternalTaskSensorException(f"The external DAG 
{self.external_dag_id} was deleted.")
 
         if self.external_task_ids:
             refreshed_dag_info = 
DagBag(dag_to_wait.fileloc).get_dag(self.external_dag_id)
             for external_task_id in self.external_task_ids:
                 if not refreshed_dag_info.has_task(external_task_id):
-                    raise AirflowException(
+                    raise AirflowExternalTaskSensorException(
                         f"The external task {external_task_id} in DAG 
{self.external_dag_id} does not exist."
                     )
 
         if self.external_task_group_id:
             refreshed_dag_info = 
DagBag(dag_to_wait.fileloc).get_dag(self.external_dag_id)
             if not 
refreshed_dag_info.has_task_group(self.external_task_group_id):
-                raise AirflowException(
+                raise AirflowExternalTaskSensorException(

Review Comment:
   I've created multiple exceptions for different cases and also update the 
test cases. Thanks for the suggestions!



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to