From b1d6470b907a3cd830a5fc67eb48d1e712f75450 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Wed, 7 Mar 2018 14:52:09 +0100 Subject: [PATCH] report text of malformed querries in Logcat removes need to create temporary debugging statements during development currently with code causing 400 errors one must create temporary debug entry outputting failing query, now this will be done automatically --- .../data/osm/download/OverpassMapDataDao.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osm/download/OverpassMapDataDao.java b/app/src/main/java/de/westnordost/streetcomplete/data/osm/download/OverpassMapDataDao.java index de583b50f7..584be46ac7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osm/download/OverpassMapDataDao.java +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osm/download/OverpassMapDataDao.java @@ -61,10 +61,14 @@ public synchronized void get(final String query, MapDataWithGeometryHandler hand } catch(OsmApiException e) { - if(e.getErrorCode() == 429) + if(e.getErrorCode() == 429) { throw new OsmTooManyRequestsException(e.getErrorCode(), e.getErrorTitle(), e.getDescription()); - else + } else if(e.getErrorCode() == 400) { + Log.e(TAG, "malformed query, caused Overpass to return error code 400: " + query); throw e; + } else { + throw e; + } } }