uranusjr commented on code in PR #49164:
URL: https://github.com/apache/airflow/pull/49164#discussion_r2108007621
##########
airflow-core/src/airflow/api_fastapi/common/exceptions.py:
##########
@@ -80,6 +82,24 @@ def _is_dialect_matched(self, exc: IntegrityError) -> bool:
return False
+class DAGErrorHandler(BaseErrorHandler[DeserializationError]):
+ """Handler for DAG-related errors."""
+
+ def __init__(self):
+ super().__init__(DeserializationError)
+
+ def exception_handler(self, request: Request, exc: DeserializationError):
+ """Handle DAG deserialization exceptions."""
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
Review Comment:
400 does not sound right to me. This is not something the client can
resolve; a 500 would be more appropriate IMO.
--
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]