Package org.openstreetmap.josm.gui
Class ExceptionDialogUtil
- java.lang.Object
-
- org.openstreetmap.josm.gui.ExceptionDialogUtil
-
public final class ExceptionDialogUtil extends java.lang.Object
This utility class provides static methods which explain various exceptions to the user.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ExceptionDialogUtil()
just static utility functions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
explainAuthenticationFailed(OsmApiException e)
Explains aOsmApiException
which was thrown because the authentication at the OSM server failedstatic void
explainAuthorizationFailed(OsmApiException e)
Explains aOsmApiException
which was thrown because accessing a protected resource was forbidden (HTTP 403).static void
explainBadRequest(OsmApiException e)
Explains aOsmApiException
which was thrown because of a bad requeststatic void
explainBandwidthLimitExceeded(OsmApiException e)
Explains aOsmApiException
which was thrown because of a bandwidth limit (HTTP 509)static void
explainChangesetClosedException(ChangesetClosedException e)
handles a ChangesetClosedExceptionstatic void
explainClientTimeout(OsmApiException e)
Explains aOsmApiException
which was thrown because of a client timeout (HTTP 408)static void
explainConflict(OsmApiException e)
Explains aOsmApiException
which was thrown because of a conflictstatic void
explainException(java.lang.Exception e)
Explains anException
to the user.static void
explainGeneric(java.lang.Exception e)
Explains an exception with a generic message dialogstatic void
explainGenericHttpException(OsmApiException e)
Explains aOsmApiException
with a generic error message.static void
explainGoneForUnknownPrimitive(OsmApiException e)
explains the case of an error due to a delete request on an already deletedOsmPrimitive
, i.e.static void
explainInternalServerError(OsmTransferException e)
Explains aOsmApiException
which was thrown because of an internal server error in the OSM API server.private static void
explainIOException(java.lang.Exception e)
Explains aIOException
static void
explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)
Explains aOsmApiException
which was thrown because accessing a protected resource was forbidden.static void
explainNestedIllegalDataException(OsmTransferException e)
Explains aIllegalDataException
which has caused anOsmTransferException
.static void
explainNestedInvocationTargetException(java.lang.Exception e)
Explains aInvocationTargetException
static void
explainNestedIOException(OsmTransferException e)
Explains aIOException
which has caused anOsmTransferException
.static void
explainNestedOfflineAccessException(OsmTransferException e)
Explains aOfflineAccessException
which has caused anOsmTransferException
.static void
explainNestedSocketException(OsmTransferException e)
Explains aSocketException
which has caused anOsmTransferException
.static void
explainNestedUnknownHostException(OsmTransferException e)
Explains aUnknownHostException
which has caused anOsmTransferException
.static void
explainNotFound(OsmApiException e)
Explains aOsmApiException
which was thrown because a resource wasn't found on the serverstatic void
explainOsmApiInitializationException(OsmApiInitializationException e)
handles an exception caught during OSM API initializationstatic void
explainOsmTransferException(OsmTransferException e)
Explains anOsmTransferException
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 aSecurityException
which has caused anOsmTransferException
.private static int
showErrorDialog(java.lang.String msg, java.lang.String title, java.lang.String helpTopic)
-
-
-
Constructor Detail
-
ExceptionDialogUtil
private ExceptionDialogUtil()
just static utility functions. no constructor
-
-
Method Detail
-
showErrorDialog
private static int showErrorDialog(java.lang.String msg, java.lang.String title, java.lang.String helpTopic)
-
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 aSecurityException
which has caused anOsmTransferException
. 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 aSocketException
which has caused anOsmTransferException
. 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 aIOException
which has caused anOsmTransferException
. This is most likely happening when the communication with the remote server is interrupted for any reason.- Parameters:
e
- the exception
-
explainIOException
private static void explainIOException(java.lang.Exception e)
Explains aIOException
- Parameters:
e
- the exception
-
explainNestedIllegalDataException
public static void explainNestedIllegalDataException(OsmTransferException e)
Explains aIllegalDataException
which has caused anOsmTransferException
. This is most likely happening when JOSM tries to load data in an unsupported format.- Parameters:
e
- the exception
-
explainNestedOfflineAccessException
public static void explainNestedOfflineAccessException(OsmTransferException e)
Explains aOfflineAccessException
which has caused anOsmTransferException
. This is most likely happening when JOSM tries to access OSM API or JOSM website while in offline mode.- Parameters:
e
- the exception- Since:
- 7434
-
explainNestedInvocationTargetException
public static void explainNestedInvocationTargetException(java.lang.Exception e)
Explains aInvocationTargetException
- Parameters:
e
- the exception
-
explainInternalServerError
public static void explainInternalServerError(OsmTransferException e)
Explains aOsmApiException
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 aOsmApiException
which was thrown because of a bad request- Parameters:
e
- the exception
-
explainNotFound
public static void explainNotFound(OsmApiException e)
Explains aOsmApiException
which was thrown because a resource wasn't found on the server- Parameters:
e
- the exception
-
explainConflict
public static void explainConflict(OsmApiException e)
Explains aOsmApiException
which was thrown because of a conflict- Parameters:
e
- the exception
-
explainAuthenticationFailed
public static void explainAuthenticationFailed(OsmApiException e)
Explains aOsmApiException
which was thrown because the authentication at the OSM server failed- Parameters:
e
- the exception
-
explainAuthorizationFailed
public static void explainAuthorizationFailed(OsmApiException e)
Explains aOsmApiException
which was thrown because accessing a protected resource was forbidden (HTTP 403).- Parameters:
e
- the exception
-
explainClientTimeout
public static void explainClientTimeout(OsmApiException e)
Explains aOsmApiException
which was thrown because of a client timeout (HTTP 408)- Parameters:
e
- the exception
-
explainBandwidthLimitExceeded
public static void explainBandwidthLimitExceeded(OsmApiException e)
Explains aOsmApiException
which was thrown because of a bandwidth limit (HTTP 509)- Parameters:
e
- the exception
-
explainGenericHttpException
public static void explainGenericHttpException(OsmApiException e)
Explains aOsmApiException
with a generic error message.- Parameters:
e
- the exception
-
explainMissingOAuthAccessTokenException
public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)
Explains aOsmApiException
which was thrown because accessing a protected resource was forbidden.- Parameters:
e
- the exception
-
explainNestedUnknownHostException
public static void explainNestedUnknownHostException(OsmTransferException e)
Explains aUnknownHostException
which has caused anOsmTransferException
. 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
-
explainOsmTransferException
public static void explainOsmTransferException(OsmTransferException e)
Explains anOsmTransferException
to the user.- Parameters:
e
- theOsmTransferException
-
explainGoneForUnknownPrimitive
public static void explainGoneForUnknownPrimitive(OsmApiException e)
explains the case of an error due to a delete request on an already deletedOsmPrimitive
, i.e. a HTTP response code 410, where we don't know whichOsmPrimitive
is causing the error.- Parameters:
e
- the exception
-
explainException
public static void explainException(java.lang.Exception e)
Explains anException
to the user.- Parameters:
e
- theException
-
-