1fanwang opened a new pull request, #68512:
URL: https://github.com/apache/airflow/pull/68512

   Follow-up to #66888 — factoring out the duplication @pierrejeambrun flagged 
in review. `DataErrorHandler` and `_UniqueConstraintErrorHandler` carried 
near-identical bodies: the lookup id, statement log, `[api] expose_stacktrace` 
gating, and the `HTTPException` detail shape were copied between them.
   
   ## What changed
   
   A new `_DatabaseErrorHandler` base owns that shared body. Each handler now 
declares only what differs — a `status_code`, a `reason`, and an optional 
`_should_handle` guard:
   
   - `_UniqueConstraintErrorHandler` → 409, keeps its per-dialect match as 
`_should_handle`.
   - `DataErrorHandler` → 422, always handles.
   
   No behavior change: same statuses, same `detail` payloads, same 
`expose_stacktrace` gating. The existing `TestUniqueConstraintErrorHandler` / 
`TestDataErrorHandler` suites run unchanged and pass, which is the regression 
guard.
   
   related: #66888
   


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