theodi / uk-postcodes

MIT License
41 stars 17 forks source link

Better way to handle out-of-bound latlng requests? #11

Closed cblanc closed 10 years ago

cblanc commented 10 years ago

I'm currently writing a node.js wrapper for the uk-postcodes.com API. I've been testing the /latlng route using valid but "inappropriate values" (e.g. 0,0)

I've been getting 500 response from the server. Was wondering if there's a more appropriate restful response?

Seeing as all /latlng requests redirect to a postcode, perhaps an "inappropriate" geolocation can redirect to a 404 error instead?

pezholio commented 10 years ago

Good shout, I'll get on that. Related to #1 too

cblanc commented 10 years ago

Great! Could you also do the same for /postcodes/nearest?postcode=[]. I'm also getting 500s for invalid postcodes.