KushagraB424 opened a new issue, #71122:
URL: https://github.com/apache/airflow/issues/71122

   ### Description
   
   The Airflow contributor guidelines explicitly state that we should reduce 
the usage of the generic `AirflowException` in favor of more specific Python 
built-ins. I noticed a few places where `AirflowException` is currently being 
used improperly and should be replaced:
   
   - In `airflow/models/connection.py`, invalid connection strings raise 
`AirflowException`. These should be updated to `ValueError`.
   - In `airflow/utils/helpers.py`, string length limits and timeouts raise 
`AirflowException`. These should be updated to `ValueError` and `TimeoutError`.
   
   I will be opening a PR for this shortly!
   
   
   ### Use case/motivation
   
   Improving codebase quality and adhering to the community's current coding 
standards by using specific exceptions (like `ValueError` and `TimeoutError`). 
This makes error handling and debugging clearer for users and contributors, 
rather than catching a broad `AirflowException`.
   
   
   ### Related issues
   
   None
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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