wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 78 forks source link

On error respond with a http status code other than 200 #50

Closed axelo closed 8 years ago

axelo commented 8 years ago

Enhancement.

Today if one have to check if there was an error response when converting we need to parse the whole response content and check if the error field is present.

An easier way would be to respond with another http status code other than 200 (Ok), 400 (Bad Request) for example.

A suggestion for a future PR:

Set status to 400 (Bad Request) at:

Set status 503 (Service Unavailable) at:

wavded commented 8 years ago

I'm down for this. Care to make a PR? The only thing I would change is 503 to a more generic 500 as that's a "catch-all" internal error handler and the service is likely still available, but that particular request causes it to wig out.

axelo commented 8 years ago

Nice! I agree that 500 is better suited. I'll be back with a PR.