File tree Expand file tree Collapse file tree 2 files changed +159
-114
lines changed
src/org/openstreetmap/josm/io
test/unit/org/openstreetmap/josm/io Expand file tree Collapse file tree 2 files changed +159
-114
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,17 @@ private void handleIllegalDataException(IllegalDataException e) throws XMLStream
201201 }
202202 }
203203
204+ private void parseError () throws XMLStreamException {
205+ while (parser .hasNext ()) {
206+ int event = parser .next ();
207+ if (event == XMLStreamConstants .CHARACTERS ) {
208+ throwException (parser .getText ());
209+ } else {
210+ throwException ("Unknown error element type" );
211+ }
212+ }
213+ }
214+
204215 private void parseRemark () throws XMLStreamException {
205216 while (parser .hasNext ()) {
206217 int event = parser .next ();
@@ -393,6 +404,8 @@ protected void parseUnknown(boolean printWarning) throws XMLStreamException {
393404 if (printWarning && ("note" .equals (element ) || "meta" .equals (element ))) {
394405 // we know that Overpass API returns those elements
395406 Logging .debug (tr ("Undefined element ''{0}'' found in input stream. Skipping." , element ));
407+ } else if ("error" .equals (element )) {
408+ parseError ();
396409 } else if (printWarning ) {
397410 Logging .info (tr ("Undefined element ''{0}'' found in input stream. Skipping." , element ));
398411 }
You can’t perform that action at this time.
0 commit comments