Zedmor commented on a change in pull request #12305:
URL: https://github.com/apache/airflow/pull/12305#discussion_r522185813
##########
File path: airflow/www/extensions/init_views.py
##########
@@ -134,12 +134,29 @@ def init_error_handlers(app: Flask):
def init_api_connexion(app: Flask) -> None:
+
+ base_path = '/api/v1'
+
+ from airflow.www import views
+
+ @app.errorhandler(404)
+ @app.errorhandler(405)
+ def _handle_api_error(ex):
+ if request.path.startswith(base_path):
+ # 404 errors are never handled on the blueprint level
+ # unless raised from a view func so actual 404 errors,
+ # i.e. "no route for it" defined, need to be handled
+ # here on the application level
+ return common_error_handler(ex)
Review comment:
Yes, see
https://github.com/apache/airflow/blob/82eef2e7b27c2bd0d68d945772dab2d1040dda8b/airflow/api_connexion/exceptions.py#L31
problem is that flask do not delegate that to common error handler from
blueprint (connexion)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]