Changeset 6514 in josm


Ignore:
Timestamp:
2013-12-23T10:05:58+01:00 (11 years ago)
Author:
simon04
Message:

fix #9467 - IllegalArgumentException: URL does not contain valid zoom

File:
1 edited

Legend:

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

    r6474 r6514  
    8888     * @param url string for parsing
    8989     * @return Bounds if hashurl, {@code null} otherwise
    90      * @throws IllegalArgumentException if URL is invalid
    9190     */
    9291    private static Bounds parseHashURLs(String url) throws IllegalArgumentException {
     
    9897        String[] parts = coordPart.split("/");
    9998        if (parts.length < 3) {
    100             throw new IllegalArgumentException(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude")));
     99            Main.warn(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude")));
     100            return null;
    101101        }
    102102        int zoom;
     
    105105            zoom = Integer.parseInt(parts[0]);
    106106        } catch (NumberFormatException e) {
    107             throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("zoom")), e);
     107            Main.warn(tr("URL does not contain valid {0}", tr("zoom")), e);
     108            return null;
    108109        }
    109110        try {
    110111            lat = Double.parseDouble(parts[1]);
    111112        } catch (NumberFormatException e) {
    112             throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("latitude")), e);
     113            Main.warn(tr("URL does not contain valid {0}", tr("latitude")), e);
     114            return null;
    113115        }
    114116        try {
    115117            lon = Double.parseDouble(parts[2]);
    116118        } catch (NumberFormatException e) {
    117             throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("longitude")), e);
     119            Main.warn(tr("URL does not contain valid {0}", tr("longitude")), e);
     120            return null;
    118121        }
    119122        return positionToBounds(lat, lon, zoom);
Note: See TracChangeset for help on using the changeset viewer.