Changeset 3412 in osm for applications


Ignore:
Timestamp:
2007-06-29T18:41:54+02:00 (17 years ago)
Author:
christofd
Message:

added error handling for plugins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pluginmanager/src/at/dallermassl/josm/plugin/pluginmanager/PluginDescription.java

    r3335 r3412  
    44package at.dallermassl.josm.plugin.pluginmanager;
    55
    6 import java.io.IOException;
    76import java.util.ArrayList;
    87import java.util.List;
    98
    10 import org.openstreetmap.josm.plugins.PluginInformation;
     9import javax.swing.JOptionPane;
     10
     11import org.openstreetmap.josm.Main;
    1112
    1213/**
     
    120121     */
    121122    public void install() {
     123        boolean errorReported = false;
     124        StringBuilder errorMessages = new StringBuilder();
    122125        for(PluginResource resource : resources) {
    123126            resource.install();
    124127            if(resource.getErrorMessage() != null) {
     128                errorReported = true;
     129                errorMessages.append(resource.getErrorMessage()).append(", ");
    125130                System.err.println("ERROR: " + resource.getErrorMessage());
    126131            }
    127132            if(resource.getErrorException() != null) {
     133                errorReported = true;
    128134                resource.getErrorException().printStackTrace();
    129135            }
     136        }
     137        if(errorReported) {
     138            JOptionPane.showMessageDialog(Main.parent, "One or more installs had an error: " + errorMessages.toString());           
    130139        }
    131140    }
Note: See TracChangeset for help on using the changeset viewer.