Ignore:
Timestamp:
09.03.2010 14:00:46 (2 years ago)
Author:
Gubaer
Message:

fixed #4684: HTTP 408 gives coding error popup

File:
1 edited

Legend:

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

    r3083 r3101  
    282282 
    283283    /** 
     284     * Explains a {@see OsmApiException} which was thrown because of a 
     285     * client timeout (HTTP 408) 
     286     * 
     287     * @param e the exception 
     288     */ 
     289    public static void explainClientTimeout(OsmApiException e) { 
     290        HelpAwareOptionPane.showOptionDialog( 
     291                Main.parent, 
     292                ExceptionUtil.explainClientTimeout(e), 
     293                tr("Client Time Out"), 
     294                JOptionPane.ERROR_MESSAGE, 
     295                ht("/ErrorMessages#ClientTimeOut") 
     296        ); 
     297    } 
     298 
     299    /** 
     300     * Explains a {@see OsmApiException} with a generic error 
     301     * message. 
     302     * 
     303     * @param e the exception 
     304     */ 
     305    public static void explainGenericHttpException(OsmApiException e) { 
     306        HelpAwareOptionPane.showOptionDialog( 
     307                Main.parent, 
     308                ExceptionUtil.explainClientTimeout(e), 
     309                tr("Communication with OSM server failed"), 
     310                JOptionPane.ERROR_MESSAGE, 
     311                ht("/ErrorMessages#GenericCommunicationError") 
     312        ); 
     313    } 
     314 
     315    /** 
    284316     * Explains a {@see OsmApiException} which was thrown because accessing a protected 
    285317     * resource was forbidden. 
     
    405437                explainAuthorizationFailed(oae); 
    406438                return; 
     439            case HttpURLConnection.HTTP_CLIENT_TIMEOUT: 
     440                explainClientTimeout(oae); 
     441                return; 
     442            default: 
     443                explainGenericHttpException(oae); 
     444                return; 
    407445            } 
    408446        } 
Note: See TracChangeset for help on using the changeset viewer.