Ignore:
Timestamp:
2020-11-22T22:54:01+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #20131 - remote control: report errors in case of OSM API error (load_and_zoom) or no valid identifier (load_object)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r16825 r17330  
    2525import org.openstreetmap.josm.data.osm.UploadPolicy;
    2626import org.openstreetmap.josm.data.preferences.BooleanProperty;
     27import org.openstreetmap.josm.data.preferences.IntegerProperty;
    2728import org.openstreetmap.josm.gui.MainApplication;
     29import org.openstreetmap.josm.io.OsmApiException;
    2830import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    2931import org.openstreetmap.josm.spi.preferences.Config;
     
    4345    /** preference to determine if remote control loads data in a new layer */
    4446    public static final BooleanProperty LOAD_IN_NEW_LAYER = new BooleanProperty("remotecontrol.new-layer", false);
     47    /** preference to define OSM download timeout in seconds */
     48    public static final IntegerProperty OSM_DOWNLOAD_TIMEOUT = new IntegerProperty("remotecontrol.osm.download.timeout", 5*60);
    4549
    4650    protected static final Pattern SPLITTER_COMMA = Pattern.compile(",\\s*");
     
    416420        /**
    417421         * Constructs a new {@code RequestHandlerErrorException}.
     422         * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
     423         * @since 17330
     424         */
     425        public RequestHandlerErrorException(String message) {
     426            super(message);
     427        }
     428
     429        /**
     430         * Constructs a new {@code RequestHandlerErrorException}.
    418431         * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
    419432         */
    420433        public RequestHandlerErrorException(Throwable cause) {
     434            super(cause);
     435        }
     436    }
     437
     438    /**
     439     * Error raised for OSM API errors.
     440     * @since 17330
     441     */
     442    public static class RequestHandlerOsmApiException extends RequestHandlerErrorException {
     443
     444        /**
     445         * Constructs a new {@code RequestHandlerOsmApiException}.
     446         * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
     447         */
     448        public RequestHandlerOsmApiException(OsmApiException cause) {
    421449            super(cause);
    422450        }
Note: See TracChangeset for help on using the changeset viewer.