Ignore:
Timestamp:
2014-07-15T16:48:46+02:00 (12 years ago)
Author:
Don-vip
Message:

see #10267 - display HTML error page sent by WMS server when applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r7015 r7312  
    2525import org.openstreetmap.josm.data.imagery.ImageryInfo;
    2626import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
     27import org.openstreetmap.josm.gui.util.GuiHelper;
    2728import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2829import org.openstreetmap.josm.io.imagery.WMSImagery;
     
    8687                            tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
    8788                } catch (WMSImagery.WMSGetCapabilitiesException ex) {
    88                     JOptionPane.showMessageDialog(getParent(), tr("Could not parse WMS layer list."),
    89                             tr("WMS Error"), JOptionPane.ERROR_MESSAGE);
    90                     Main.error("Could not parse WMS layer list. Incoming data:\n"+ex.getIncomingData());
     89                    String incomingData = ex.getIncomingData().trim();
     90                    String title = tr("WMS Error");
     91                    String message = tr("Could not parse WMS layer list.");
     92                    Main.error("Could not parse WMS layer list. Incoming data:\n"+incomingData);
     93                    if (incomingData != null
     94                            && (incomingData.startsWith("<html>") || incomingData.startsWith("<HTML>"))
     95                            && (incomingData.endsWith("</html>") || incomingData.endsWith("</HTML>"))) {
     96                        GuiHelper.notifyUserHtmlError(AddWMSLayerPanel.this, title, message, incomingData);
     97                    } else {
     98                        JOptionPane.showMessageDialog(getParent(), message, title, JOptionPane.ERROR_MESSAGE);
     99                    }
    91100                }
    92101            }
Note: See TracChangeset for help on using the changeset viewer.