[OSM-dev] Finding parent ways of a node - 400 error - inappropriate?

Nick Whitelegg nick at hogweed.org
Tue Nov 20 22:05:43 GMT 2007


I'm developing a routine on the osmajax editor which deletes a way *and* any 
nodes in that way which are not shared with other ways. As soon as the way is 
deleted, I loop through the nodes, calling the api/0.5/node/nodeid/ways call 
to see if the nodes have any remaining parent ways.

If the node has no parent ways, I want to delete it. On calling the API, 
however, it returns a 400 error. It doesn't however seem to be something for 
which raising an error is appropriate, it seems to me to be part of the 
normal course of flow, in which the node just so happens to not have any 
parent ways - something I'm deliberately trying to test for in my client code 
in order to determine whether to delete the node or not.

I can still do it (by testing for a 400 error) but this does seem to be a 
little inappropriate as it's not really an error. I would say a blank XML 
document (with a 200 OK) would seem a more appropriate response to the API 
call- any thoughts on this?

Thanks,
Nick




More information about the dev mailing list