Replies: 2 comments 1 reply
-
hiya @cjolson64 we have been building out a frontend over our ERDDAP instance too. Current version is we have also started making smaller custom dashboards for smaller collections of data sealevel I'll mention this to one of our developers leading on the dashboard. @SarahSidders but for what its worth, my option is that the returning of a 404 for when data cannot be found is correct, both in terms of the restful standard and in how I would expect an API to work. the CORS issue is interesting, do you have control over the erddap instance or can you request changes from your web admin? |
Beta Was this translation helpful? Give feedback.
-
I do wish a different HTTP status code had originally been chosen for this situation (requested dataset found, but no data matching query parameters), maybe 400 BAD REQUEST. Changing it or making it configurable now would be very painful though. For the CORS issue, if you're using the https://tomcat.apache.org/tomcat-9.0-doc/config/filter.html The https://github.com/Unidata/tomcat-docker/blob/latest/web.xml#L629-L641 I'm not seeing an option to enable CORS headers on error responses for |
Beta Was this translation helpful? Give feedback.
-
I've been building a basic web frontend for some datasets I have in ERDDAP and am running into a bit of messiness with some of my GET requests. When I run a query where there are no results, say because there is no data between the date ranges provided or some other type of filtering, I am getting a 404 error. I think 404 makes sense if the dataset cannot be found, but I feel like this should still give a 200 just with zero results, definitely open to having my mind changed though.
The real issue though is that whenever I get a 404 in this situation it comes back without CORS headers. Has anyone else run into this situation?
Beta Was this translation helpful? Give feedback.
All reactions