- Timestamp:
- 2014-10-17T00:45:28+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r7082 r7628 31 31 import javax.swing.JButton; 32 32 import javax.swing.JLabel; 33 import javax.swing.JOptionPane; 33 34 import javax.swing.JPanel; 34 35 import javax.swing.JScrollPane; … … 50 51 import org.openstreetmap.josm.data.Bounds; 51 52 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 53 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 52 54 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 55 import org.openstreetmap.josm.gui.util.GuiHelper; 53 56 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 54 57 import org.openstreetmap.josm.gui.widgets.JosmComboBox; … … 61 64 import org.xml.sax.InputSource; 62 65 import org.xml.sax.SAXException; 66 import org.xml.sax.SAXParseException; 63 67 import org.xml.sax.helpers.DefaultHandler; 64 68 … … 379 383 this.data = parser.getResult(); 380 384 } 381 } catch(Exception e) { 382 if (canceled) 383 // ignore exception 384 return; 385 OsmTransferException ex = new OsmTransferException(e); 386 ex.setUrl(urlString); 387 lastException = ex; 385 } catch (SAXParseException e) { 386 if (!canceled) { 387 // Nominatim sometimes returns garbage, see #5934, #10643 388 Main.warn(tr("Error occured with query ''{0}'': ''{1}''", urlString, e.getMessage())); 389 GuiHelper.runInEDTAndWait(new Runnable() { 390 @Override 391 public void run() { 392 HelpAwareOptionPane.showOptionDialog( 393 Main.parent, 394 tr("Name server returned invalid data. Please try again."), 395 tr("Bad response"), 396 JOptionPane.WARNING_MESSAGE, null 397 ); 398 } 399 }); 400 } 401 } catch (Exception e) { 402 if (!canceled) { 403 OsmTransferException ex = new OsmTransferException(e); 404 ex.setUrl(urlString); 405 lastException = ex; 406 } 388 407 } 389 408 }
Note:
See TracChangeset
for help on using the changeset viewer.