omkar-foss commented on code in PR #65423:
URL: https://github.com/apache/airflow/pull/65423#discussion_r3170100239


##########
airflow-core/src/airflow/models/connection.py:
##########
@@ -527,7 +527,9 @@ def get_connection_from_secrets(cls, conn_id: str, 
team_name: str | None = None)
                 return conn
             except AirflowRuntimeError as e:
                 if e.error.error == ErrorType.CONNECTION_NOT_FOUND:
-                    raise AirflowNotFoundException(f"The conn_id `{conn_id}` 
isn't defined") from None
+                    raise AirflowNotFoundException(
+                        f"The conn_id `{conn_id}` isn't defined", 
error_code="AERR002"

Review Comment:
   Initially I did keep error_code embedded in the exception, but with that 
devs will need to update for all old/existing raises for exception class.
   
   e.g. If dev uses error_code with `NodeNotFound`, there are two raises for it 
- in dag and task group. So 2 error codes will need to be defined for both 
raises respectively. And this may be a problem if dev has context only on one 
of those raises. And also if number of raises is too large (like 
AirflowBadRequest)



-- 
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