haseebmalik18 opened a new pull request, #70152:
URL: https://github.com/apache/airflow/pull/70152
The AWS DataSync operator raised the catch-all `AirflowException` for ten
unrelated conditions, so a DAG author could not distinguish an invalid
constructor call from a failed task execution when handling errors.
This narrows each usage to a specific type:
- **Usage/validation errors** now raise `ValueError`.
- **Runtime domain failures** raise dedicated exceptions added to
`aws/exceptions.py`:
- `DataSyncTaskNotFoundError`
- `DataSyncMultipleTasksError` / `DataSyncMultipleLocationsError`
- `DataSyncLocationNotFoundError`
- `DataSyncTaskCreationError`
- `DataSyncTaskExecutionFailedError`
The new classes subclass `AirflowException`, so existing `except
AirflowException` handlers keep working, with no breaking change.
Tests are updated to assert the specific types, with added coverage for the
raise sites that were previously untested.
Part of the ongoing effort to reduce direct `AirflowException` usage. The
`check-no-new-airflow-exceptions` allowlist entry for this file is tightened
from 10 to 0.
--
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]