org.openstreetmap.josm.gui
Class ExceptionDialogUtil

java.lang.Object
  extended by org.openstreetmap.josm.gui.ExceptionDialogUtil

public class ExceptionDialogUtil
extends java.lang.Object

This utility class provides static methods which explain various exceptions to the user.


Constructor Summary
private ExceptionDialogUtil()
          just static utility functions.
 
Method Summary
static void explainAuthenticationFailed(OsmApiException e)
          Explains a OsmApiException which was thrown because the authentication at the OSM server failed
static void explainAuthorizationFailed(OsmApiException e)
          Explains a OsmApiException which was thrown because accessing a protected resource was forbidden.
static void explainBadRequest(OsmApiException e)
          Explains a OsmApiException which was thrown because of a bad request
static void explainBandwidthLimitExceeded(OsmApiException e)
          Explains a OsmApiException which was thrown because of a bandwidth limit (HTTP 509)
static void explainChangesetClosedException(ChangesetClosedException e)
          handles a ChangesetClosedException
static void explainClientTimeout(OsmApiException e)
          Explains a OsmApiException which was thrown because of a client timeout (HTTP 408)
static void explainConflict(OsmApiException e)
          Explains a OsmApiException which was thrown because of a conflict
static void explainException(java.lang.Exception e)
          Explains an Exception to the user.
static void explainGeneric(java.lang.Exception e)
          Explains an exception with a generic message dialog
static void explainGenericHttpException(OsmApiException e)
          Explains a OsmApiException with a generic error message.
static void explainGoneForUnknownPrimitive(OsmApiException e)
          explains the case of an error due to a delete request on an already deleted OsmPrimitive, i.e.
static void explainInternalServerError(OsmTransferException e)
          Explains a OsmApiException which was thrown because of an internal server error in the OSM API server.
static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)
          Explains a OsmApiException which was thrown because accessing a protected resource was forbidden.
static void explainNestedIllegalDataException(OsmTransferException e)
          Explains a IllegalDataException which has caused an OsmTransferException.
static void explainNestedInvocationTargetException(java.lang.Exception e)
          Explains a InvocationTargetException
static void explainNestedIOException(OsmTransferException e)
          Explains a IOException which has caused an OsmTransferException.
static void explainNestedSocketException(OsmTransferException e)
          Explains a SocketException which has caused an OsmTransferException.
static void explainNestedUnkonwnHostException(OsmTransferException e)
          Explains a UnknownHostException which has caused an OsmTransferException.
static void explainNotFound(OsmApiException e)
          Explains a OsmApiException which was thrown because a resource wasn't found on the server
static void explainOsmApiInitializationException(OsmApiInitializationException e)
          handles an exception caught during OSM API initialization
static void explainOsmTransferException(OsmTransferException e)
          Explains an OsmTransferException to the user.
static void explainPreconditionFailed(OsmApiException e)
          Explains an upload error due to a violated precondition, i.e.
static void explainSecurityException(OsmTransferException e)
          Explains a SecurityException which has caused an OsmTransferException.
protected static
<T> T
getNestedException(java.lang.Exception e, java.lang.Class<T> nestedClass)
          Replies the first nested exception of type nestedClass (including the root exception e) or null, if no such exception is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionDialogUtil

private ExceptionDialogUtil()
just static utility functions. no constructor

Method Detail

explainOsmApiInitializationException

public static void explainOsmApiInitializationException(OsmApiInitializationException e)
handles an exception caught during OSM API initialization

Parameters:
e - the exception

explainChangesetClosedException

public static void explainChangesetClosedException(ChangesetClosedException e)
handles a ChangesetClosedException

Parameters:
e - the exception

explainPreconditionFailed

public static void explainPreconditionFailed(OsmApiException e)
Explains an upload error due to a violated precondition, i.e. a HTTP return code 412

Parameters:
e - the exception

explainGeneric

public static void explainGeneric(java.lang.Exception e)
Explains an exception with a generic message dialog

Parameters:
e - the exception

explainSecurityException

public static void explainSecurityException(OsmTransferException e)
Explains a SecurityException which has caused an OsmTransferException. This is most likely happening when user tries to access the OSM API from within an applet which wasn't loaded from the API server.

Parameters:
e - the exception

explainNestedSocketException

public static void explainNestedSocketException(OsmTransferException e)
Explains a SocketException which has caused an OsmTransferException. This is most likely because there's not connection to the Internet or because the remote server is not reachable.

Parameters:
e - the exception

explainNestedIOException

public static void explainNestedIOException(OsmTransferException e)
Explains a IOException which has caused an OsmTransferException. This is most likely happening when the communication with the remote server is interrupted for any reason.

Parameters:
e - the exception

explainNestedIllegalDataException

public static void explainNestedIllegalDataException(OsmTransferException e)
Explains a IllegalDataException which has caused an OsmTransferException. This is most likely happening when JOSM tries to load data in in an unsupported format.

Parameters:
e - the exception

explainNestedInvocationTargetException

public static void explainNestedInvocationTargetException(java.lang.Exception e)
Explains a InvocationTargetException

Parameters:
e - the exception

explainInternalServerError

public static void explainInternalServerError(OsmTransferException e)
Explains a OsmApiException which was thrown because of an internal server error in the OSM API server.

Parameters:
e - the exception

explainBadRequest

public static void explainBadRequest(OsmApiException e)
Explains a OsmApiException which was thrown because of a bad request

Parameters:
e - the exception

explainNotFound

public static void explainNotFound(OsmApiException e)
Explains a OsmApiException which was thrown because a resource wasn't found on the server

Parameters:
e - the exception

explainConflict

public static void explainConflict(OsmApiException e)
Explains a OsmApiException which was thrown because of a conflict

Parameters:
e - the exception

explainAuthenticationFailed

public static void explainAuthenticationFailed(OsmApiException e)
Explains a OsmApiException which was thrown because the authentication at the OSM server failed

Parameters:
e - the exception

explainAuthorizationFailed

public static void explainAuthorizationFailed(OsmApiException e)
Explains a OsmApiException which was thrown because accessing a protected resource was forbidden.

Parameters:
e - the exception

explainClientTimeout

public static void explainClientTimeout(OsmApiException e)
Explains a OsmApiException which was thrown because of a client timeout (HTTP 408)

Parameters:
e - the exception

explainBandwidthLimitExceeded

public static void explainBandwidthLimitExceeded(OsmApiException e)
Explains a OsmApiException which was thrown because of a bandwidth limit (HTTP 509)

Parameters:
e - the exception

explainGenericHttpException

public static void explainGenericHttpException(OsmApiException e)
Explains a OsmApiException with a generic error message.

Parameters:
e - the exception

explainMissingOAuthAccessTokenException

public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)
Explains a OsmApiException which was thrown because accessing a protected resource was forbidden.

Parameters:
e - the exception

explainNestedUnkonwnHostException

public static void explainNestedUnkonwnHostException(OsmTransferException e)
Explains a UnknownHostException which has caused an OsmTransferException. This is most likely happening when there is an error in the API URL or when local DNS services are not working.

Parameters:
e - the exception

getNestedException

protected static <T> T getNestedException(java.lang.Exception e,
                                          java.lang.Class<T> nestedClass)
Replies the first nested exception of type nestedClass (including the root exception e) or null, if no such exception is found.

Type Parameters:
T -
Parameters:
e - the root exception
nestedClass - the type of the nested exception
Returns:
the first nested exception of type nestedClass (including the root exception e) or null, if no such exception is found.

explainOsmTransferException

public static void explainOsmTransferException(OsmTransferException e)
Explains an OsmTransferException to the user.

Parameters:
e - the OsmTransferException

explainGoneForUnknownPrimitive

public static void explainGoneForUnknownPrimitive(OsmApiException e)
explains the case of an error due to a delete request on an already deleted OsmPrimitive, i.e. a HTTP response code 410, where we don't know which OsmPrimitive is causing the error.

Parameters:
e - the exception

explainException

public static void explainException(java.lang.Exception e)
Explains an Exception to the user.

Parameters:
e - the Exception


JOSM