Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Wrong error on updates with no XML payload #1874

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment
Closed

Wrong error on updates with no XML payload #1874

openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: randomjunk
[Submitted to the original trac issue database at 7.39am, Wednesday, 27th May 2009]

If you do a delete request, but either forget the XML payload, or else your wonderful library strips it for you, the API returns a 500 error complaining of a TypeError.

This is because the from_xml calls don't check for xml.nil? or an empty payload, and then don't rescue the TypeError that ends up being thrown.

This case should be caught and a helpful 400 error returned instead.

@openstreetmap-trac
Copy link
Author

Author: mmd
[Added to the original trac issue at 5.46pm, Tuesday, 19th May 2020]

Test DELETE https://master.apis.dev.openstreetmap.org/api/0.6/way/4305417292

Response HTTP 400 with body "Cannot parse valid way from xml string . Must specify a string with one or more characters"

-> closing here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant