Ignore:
Timestamp:
2009-08-29T11:20:57+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3138: 500 - Internal Server Error while downloading GPS-raw and OSM data

File:
1 edited

Legend:

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

    r1989 r2002  
    3737    public static void explainOsmApiInitializationException(OsmApiInitializationException e) {
    3838        e.printStackTrace();
    39         OptionPaneUtil.showMessageDialog(
     39        JOptionPane.showMessageDialog(
    4040                Main.parent,
    4141                tr(   "Failed to initialize communication with the OSM server {0}.\n"
     
    5656    public static void explainPreconditionFailed(OsmApiException e) {
    5757        e.printStackTrace();
    58         OptionPaneUtil.showMessageDialog(
     58        JOptionPane.showMessageDialog(
    5959                Main.parent,
    6060                tr("<html>Uploading to the server <strong>failed</strong> because your current<br>"
     
    8282        }
    8383        e.printStackTrace();
    84         OptionPaneUtil.showMessageDialog(
     84        JOptionPane.showMessageDialog(
    8585                Main.parent,
    8686                msg,
     
    113113                apiUrl, host
    114114        );
    115         OptionPaneUtil.showMessageDialog(
     115        JOptionPane.showMessageDialog(
    116116                Main.parent,
    117117                message,
     
    137137        );
    138138        e.printStackTrace();
    139         OptionPaneUtil.showMessageDialog(
     139        JOptionPane.showMessageDialog(
    140140                Main.parent,
    141141                message,
     
    163163        );
    164164        e.printStackTrace();
    165         OptionPaneUtil.showMessageDialog(
     165        JOptionPane.showMessageDialog(
    166166                Main.parent,
    167167                message,
    168168                tr("IO Exception"),
     169                JOptionPane.ERROR_MESSAGE
     170        );
     171    }
     172
     173    /**
     174     * Explains a {@see OsmApiException} which was thrown because of an internal server
     175     * error in the OSM API server..
     176     *
     177     * @param e the exception
     178     */
     179
     180    public static void explainInternalServerError(OsmTransferException e) {
     181        String apiUrl = OsmApi.getOsmApi().getBaseUrl();
     182        String message = tr("<html>The OSM server<br>"
     183                + "''{0}''<br>"
     184                + "reported an internal server error.<br>"
     185                + "This is most likely a temporary problem. Please try again later.</html>",
     186                apiUrl
     187        );
     188        e.printStackTrace();
     189        JOptionPane.showMessageDialog(
     190                Main.parent,
     191                message,
     192                tr("Internal Server Error"),
    169193                JOptionPane.ERROR_MESSAGE
    170194        );
     
    195219        );
    196220        e.printStackTrace();
    197         OptionPaneUtil.showMessageDialog(
     221        JOptionPane.showMessageDialog(
    198222                Main.parent,
    199223                message,
     
    261285                return;
    262286            }
     287            if (oae.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
     288                explainInternalServerError(oae);
     289                return;
     290            }
    263291        }
    264292        explainGeneric(e);
     
    281309                e.getMessage().replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
    282310        );
    283         OptionPaneUtil.showMessageDialog(
     311        JOptionPane.showMessageDialog(
    284312                Main.parent,
    285313                msg,
Note: See TracChangeset for help on using the changeset viewer.