Changeset 2282 in osm for utils


Ignore:
Timestamp:
2007-03-19T12:20:44+01:00 (18 years ago)
Author:
frsantos
Message:

Shows a more friendly error if cannot start browser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/GeckoSupport.java

    r2264 r2282  
    11package org.openstreetmap.josm.plugins.ywms;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.IOException;
     
    3537                builder.environment().put("MOZ_NO_REMOTE", "1");
    3638               
    37                 return builder.start();
     39        return startProcess(builder);
    3840        }
     41
     42    /**
     43     * Starts the process
     44     *
     45     * @param builder The builder for the process
     46     * @return The started process
     47     * @throws IOException If coulnd't start the process
     48     */
     49    private static Process startProcess(ProcessBuilder builder) throws IOException
     50    {
     51        try
     52        {
     53            return builder.start();
     54        }
     55        catch(IOException ioe)
     56        {
     57            throw new IOException( tr("Could not start browser. Please check that the executable path is correct."));
     58        }
     59    }
    3960       
    4061        /**
     
    7091                        environment.put("MOZ_FORCE_PAINT_AFTER_ONLOAD", System.getProperty("java.io.tmpdir") + "/ywms");
    7192               
    72                 return builder.start();
     93                return startProcess(builder);
    7394        }
    7495       
Note: See TracChangeset for help on using the changeset viewer.