Index: trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 7627)
+++ trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 7628)
@@ -31,4 +31,5 @@
 import javax.swing.JButton;
 import javax.swing.JLabel;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -50,5 +51,7 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
@@ -61,4 +64,5 @@
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
 
@@ -379,11 +383,26 @@
                     this.data = parser.getResult();
                 }
-            } catch(Exception e) {
-                if (canceled)
-                    // ignore exception
-                    return;
-                OsmTransferException ex = new OsmTransferException(e);
-                ex.setUrl(urlString);
-                lastException = ex;
+            } catch (SAXParseException e) {
+                if (!canceled) {
+                    // Nominatim sometimes returns garbage, see #5934, #10643
+                    Main.warn(tr("Error occured with query ''{0}'': ''{1}''", urlString, e.getMessage()));
+                    GuiHelper.runInEDTAndWait(new Runnable() {
+                        @Override
+                        public void run() {
+                            HelpAwareOptionPane.showOptionDialog(
+                                    Main.parent,
+                                    tr("Name server returned invalid data. Please try again."),
+                                    tr("Bad response"),
+                                    JOptionPane.WARNING_MESSAGE, null
+                            );
+                        }
+                    });
+                }
+            } catch (Exception e) {
+                if (!canceled) {
+                    OsmTransferException ex = new OsmTransferException(e);
+                    ex.setUrl(urlString);
+                    lastException = ex;
+                }
             }
         }
