Zedmor opened a new pull request #12305:
URL: https://github.com/apache/airflow/pull/12305


   In case of existing issue, reference it using one of the following:
   
   closes: https://github.com/apache/airflow/issues/12131
   
   ### JSON is not returned for API requests with incorrect endpoint
   
   Reason of 12131 is happening is that blueprint level handlers are not 
possible for 404 and 405. See references:
   
   
https://stackoverflow.com/questions/58728366/python-flask-error-handling-with-blueprints
   https://github.com/pallets/flask/issues/1935
   
   and therefore 404 exception handling spill out to application level handler 
(circles).
   
   I am looking forward to better implementation but this works.
   
   ```
    ~  curl http://localhost:5000/api/v1/daggggs
   {
     "detail": "The requested URL was not found on the server. If you entered 
the URL manually please check your spelling and try again.",
     "status": 404,
     "title": "Not Found",
     "type": "about:blank"
   ```
   
   ```
    ~  curl http://localhost:5000/fafs          
   
   
   <!DOCTYPE html>
   <html>
   <head>
     <title>Airflow 404 = lots of circles</title>
   ```


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


Reply via email to