Ignore:
Timestamp:
2010-03-02T17:16:24+01:00 (14 years ago)
Author:
Gubaer
Message:

see #4588: Open Location (Ctrl+L) should cope with certain URLs that don't lead to xml data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java

    r3023 r3069  
    2121import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
    2222import org.openstreetmap.josm.io.ChangesetClosedException;
     23import org.openstreetmap.josm.io.IllegalDataException;
    2324import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
    2425import org.openstreetmap.josm.io.OsmApi;
     
    283284
    284285    /**
     286     * Explains a {@see IllegalDataException} which has caused an {@see OsmTransferException}.
     287     * This is most likely happening when JOSM tries to load data in in an unsupported format.
     288     *
     289     * @param e the exception
     290     */
     291    public static String explainNestedIllegalDataException(OsmTransferException e) {
     292        IllegalDataException ide = getNestedException(e, IllegalDataException.class);
     293        String message = tr("<html>Failed to download data."
     294                + "Its format is either unsupported, ill-formed, and/or inconsistent.<br>"
     295                + "<br>Details(untranslated): {0}</html>", ide.getMessage());
     296        e.printStackTrace();
     297        return message;
     298    }
     299
     300    /**
    285301     * Explains a {@see OsmApiException} which was thrown because of an internal server
    286302     * error in the OSM API server..
     
    306322        String apiUrl = OsmApi.getOsmApi().getBaseUrl();
    307323        String message = tr("The OSM server ''{0}'' reported a bad request.<br>", apiUrl);
    308         if (e.getErrorHeader() != null && 
    309                 (e.getErrorHeader().startsWith("The maximum bbox") || 
    310                 e.getErrorHeader().startsWith("You requested too many nodes"))) {
     324        if (e.getErrorHeader() != null &&
     325                (e.getErrorHeader().startsWith("The maximum bbox") ||
     326                        e.getErrorHeader().startsWith("You requested too many nodes"))) {
    311327            message += "<br>"
    312328                + tr("The area you tried to download is too big or your request was too large."
Note: See TracChangeset for help on using the changeset viewer.