gicait / geoserver-rest

Python library for management of geospatial data in GeoServer.
https://geoserver-rest.readthedocs.io
MIT License
197 stars 79 forks source link

Layergroup creation bugfix #97

Closed julescarpentier closed 1 year ago

julescarpentier commented 1 year ago

Hi,

Geoserver now returns 404 HTTP error code when requesting for a resource that doesn't exists (instead of 200 OK with empty JSON before I imagine)

This impacts the layergroup creation method as it checks a layergroup with the same name doesn't exists already.

Best regards

iamtekson commented 1 year ago

That's the correct status code for non-existing layergroups. I think it is not necessary to bypass the 404 error.

julescarpentier commented 1 year ago

I agree, 404 is the correct status code for non-existing layergroups. If no bypass, then the check for an existing layergroup with that name should be removed. Because as it is, when creating a new layergroup, the check expects None from get_layergroup() yet this function raises an Exception since the layer doesn't exist.