Changeset 7048 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-05-02T02:37:08+02:00 (10 years ago)
Author:
Don-vip
Message:

sonar - Throwable and Error classes should not be caught

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

Legend:

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

    r7005 r7048  
    6464                importers.add(importer);
    6565                MapView.addLayerChangeListener(importer);
    66             } catch (Throwable t) {
    67                 Main.debug(t.getMessage());
     66            } catch (Exception e) {
     67                Main.debug(e.getMessage());
    6868            }
    6969        }
     
    8585                exporters.add(exporter);
    8686                MapView.addLayerChangeListener(exporter);
    87             } catch (Throwable t) {
    88                 Main.debug(t.getMessage());
     87            } catch (Exception e) {
     88                Main.debug(e.getMessage());
    8989            }
    9090        }
  • trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java

    r7033 r7048  
    174174            } catch (IOException e) {
    175175                handleException(tr("IO Error"), e);
    176             } catch (RuntimeException e) {
    177                 cancel();
    178                 throw e;
    179             } catch (Error e) {
     176            } catch (Exception e) {
    180177                cancel();
    181178                throw e;
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r7033 r7048  
    179179            try {
    180180                proj = pc.getProjection();
    181             } catch (Throwable t) {
    182                 String cause = t.getMessage();
     181            } catch (Exception e) {
     182                String cause = e.getMessage();
    183183                Main.warn("Unable to get projection "+code+" with "+pc + (cause != null ? ". "+cause : ""));
    184184            }
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r7012 r7048  
    6464                try {
    6565                    instance.initFromOAuth(Main.parent);
    66                 } catch (Throwable t) {
    67                     Main.error(t);
     66                } catch (Exception e) {
     67                    Main.error(e);
    6868                    // Fall back to preferences if OAuth identification fails for any reason
    6969                    instance.initFromPreferences();
     
    278278                try {
    279279                    instance.initFromOAuth(Main.parent);
    280                 } catch (Throwable t) {
    281                     Main.error(t);
     280                } catch (Exception e) {
     281                    Main.error(e);
    282282                }
    283283            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r7026 r7048  
    562562                                } catch (SecurityException ex) {
    563563                                    Main.error(ex);
    564                                 } catch (Throwable ex) {
     564                                } catch (Exception ex) {
    565565                                    BugReportExceptionHandler.handleException(ex);
    566566                                } finally {
     
    576576                } catch (SecurityException ex) {
    577577                    Main.error(ex);
    578                 } catch (Throwable ex) {
     578                } catch (Exception ex) {
    579579                    // allow to change most settings even if e.g. a plugin fails
    580580                    BugReportExceptionHandler.handleException(ex);
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r7025 r7048  
    571571                        + "Delete from preferences?</html>", plugin.name, plugin.className);
    572572            }
    573         }  catch (Throwable e) {
     573        }  catch (Exception e) {
    574574            Main.error(e);
    575575        }
Note: See TracChangeset for help on using the changeset viewer.