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


Ignore:
Timestamp:
2009-11-08T18:51:51+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3864: Exception handling improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java

    r2387 r2413  
    66
    77import java.io.IOException;
     8import java.lang.reflect.InvocationTargetException;
    89import java.net.HttpURLConnection;
    910import java.net.SocketException;
     
    1718import org.openstreetmap.josm.io.OsmChangesetCloseException;
    1819import org.openstreetmap.josm.io.OsmTransferException;
     20import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    1921import org.openstreetmap.josm.tools.ExceptionUtil;
    2022
     
    8284     */
    8385    public static void explainGeneric(Exception e) {
     86        e.printStackTrace();
    8487        HelpAwareOptionPane.showOptionDialog(
    8588                Main.parent,
     
    146149
    147150    /**
     151     * Explains a {@see InvocationTargetException }
     152     *
     153     * @param e the exception
     154     */
     155
     156    public static void explainNestedInvocationTargetException(Exception e) {
     157        InvocationTargetException ex = getNestedException(e, InvocationTargetException.class);
     158        if (ex != null) {
     159            // Users should be able to submit a bug report for an invocation target exception
     160            //
     161            BugReportExceptionHandler.handleException(ex);
     162            return;
     163        }
     164    }
     165
     166    /**
    148167     * Explains a {@see OsmApiException} which was thrown because of an internal server
    149      * error in the OSM API server..
     168     * error in the OSM API server.
    150169     *
    151170     * @param e the exception
     
    334353     */
    335354    public static void explainException(Exception e) {
     355        if (getNestedException(e, InvocationTargetException.class) != null) {
     356            explainNestedInvocationTargetException(e);
     357            return;
     358        }
    336359        if (e instanceof OsmTransferException) {
    337360            explainOsmTransferException((OsmTransferException) e);
Note: See TracChangeset for help on using the changeset viewer.