amoghrajesh commented on PR #52968:
URL: https://github.com/apache/airflow/pull/52968#issuecomment-3044249401

   > We have the same try/except wrapping _get_connection in two places - is 
there a reason we don't handle inside that fn?
   
   I checked on this and I see the general trend:
   
   - SDK client raised `ErrorResponse` with `ErrorType` for generic client 
related errors:
   ```
   class ErrorType(enum.Enum):
       """Error types used in the API client."""
   
       CONNECTION_NOT_FOUND = "CONNECTION_NOT_FOUND"
       VARIABLE_NOT_FOUND = "VARIABLE_NOT_FOUND"
       XCOM_NOT_FOUND = "XCOM_NOT_FOUND"
       ASSET_NOT_FOUND = "ASSET_NOT_FOUND"
       DAGRUN_ALREADY_EXISTS = "DAGRUN_ALREADY_EXISTS"
       GENERIC_ERROR = "GENERIC_ERROR"
       API_SERVER_ERROR = "API_SERVER_ERROR"
   ```
   
   - These are captured and translated to `AirflowRuntimeError` in the task SDK 
runtime functions like connection, variables, dag run already exists etc. I 
guess this was done for convenience over using `AirflowNotFoundException` and 
other types of exceptions over just matching just `AirflowRuntimeError`?
   


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