drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
693 stars 90 forks source link

Inconsistent error messages among output types #620

Closed Mashin6 closed 3 years ago

Mashin6 commented 3 years ago

Currently when something goes wrong with a query the api responds in different way depending on which out: type was selected.

  1. when syntax error or bbox out of range fails silently (csv, json, xml)
  2. when query ran and timed out returns only header (csv)
  3. When no slots available and query times out while waiting in the queue fails silently (csv, json, xml)

Particularly problematic is csv because it gives no error messages at all.

mmd-osm commented 3 years ago

Duplicate of #145

drolbr commented 3 years ago

A syntax error should result in a HTTP 400 Bad Request. I do not understand what you mean by "bbox out of range". A timeout is indeed not signalled in csv, because there is no obvious place for error messages in csv. Load shedding is indicated by HTTP 504 if the server is overloaded or HTTP 429 if the server had seen too many requests from the IP address. Please see the user's manual.

Mashin6 commented 3 years ago

Actually you are right wget returns 400 Bad Request, which I didn't see because I was only looking at output. But I found out that curl also returns syntax error as e.g. ...

Error: line 2: parse error: Key expected - ';' found.

...

And the same happens also for bbox out of bounds e.g. with [bbox:-90,-180,90,280] so curl solved this for me.