Changeset 10101 in josm for trunk/src/org


Ignore:
Timestamp:
2016-04-03T14:54:24+02:00 (9 years ago)
Author:
Don-vip
Message:

fix #12705 - catch scripting errors with Java 7 when building invalid overpass API queries

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/OverpassDownloadAction.java

    r9484 r10101  
    159159                        overpassQuery.setText(OverpassTurboQueryWizard.getInstance().constructQuery(overpassWizardText));
    160160                    } catch (UncheckedParseException ex) {
     161                        Main.error(ex);
    161162                        HelpAwareOptionPane.showOptionDialog(
    162163                                Main.parent,
  • trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java

    r9997 r10101  
    6262     * @throws UncheckedParseException when the parsing fails
    6363     */
    64     public String constructQuery(String search) throws UncheckedParseException {
     64    public String constructQuery(String search) {
    6565        try {
    6666            final Object result = ((Invocable) engine).invokeFunction("overpassWizard", search);
     
    7474            throw new IllegalStateException(e);
    7575        } catch (ScriptException e) {
    76             throw new RuntimeException("Failed to execute OverpassTurboQueryWizard", e);
     76            throw new UncheckedParseException("Failed to execute OverpassTurboQueryWizard", e);
    7777        }
    7878    }
Note: See TracChangeset for help on using the changeset viewer.