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 privateExceptionDialogUtil()just static utility functions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexplainAuthenticationFailed(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because the authentication at the OSM server failedstatic voidexplainAuthorizationFailed(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because accessing a protected resource was forbidden (HTTP 403).static voidexplainBadRequest(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because of a bad requeststatic voidexplainBandwidthLimitExceeded(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because of a bandwidth limit (HTTP 509)static voidexplainChangesetClosedException(ChangesetClosedException e)handles a ChangesetClosedExceptionstatic voidexplainClientTimeout(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because of a client timeout (HTTP 408)static voidexplainConflict(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because of a conflictstatic voidexplainException(java.lang.Exception e)Explains anExceptionto the user.static voidexplainGeneric(java.lang.Exception e)Explains an exception with a generic message dialogstatic voidexplainGenericHttpException(OsmApiException e)Explains aOsmApiExceptionwith a generic error message.static voidexplainGoneForUnknownPrimitive(OsmApiException e)explains the case of an error due to a delete request on an already deletedOsmPrimitive, i.e.static voidexplainInternalServerError(OsmTransferException e)Explains aOsmApiExceptionwhich was thrown because of an internal server error in the OSM API server.private static voidexplainIOException(java.lang.Exception e)Explains aIOExceptionstatic voidexplainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)Explains aOsmApiExceptionwhich was thrown because accessing a protected resource was forbidden.static voidexplainNestedIllegalDataException(OsmTransferException e)Explains aIllegalDataExceptionwhich has caused anOsmTransferException.static voidexplainNestedInvocationTargetException(java.lang.Exception e)Explains aInvocationTargetExceptionstatic voidexplainNestedIOException(OsmTransferException e)Explains aIOExceptionwhich has caused anOsmTransferException.static voidexplainNestedOfflineAccessException(OsmTransferException e)Explains aOfflineAccessExceptionwhich has caused anOsmTransferException.static voidexplainNestedSocketException(OsmTransferException e)Explains aSocketExceptionwhich has caused anOsmTransferException.static voidexplainNestedUnknownHostException(OsmTransferException e)Explains aUnknownHostExceptionwhich has caused anOsmTransferException.static voidexplainNotFound(OsmApiException e)Explains aOsmApiExceptionwhich was thrown because a resource wasn't found on the serverstatic voidexplainOsmApiInitializationException(OsmApiInitializationException e)handles an exception caught during OSM API initializationstatic voidexplainOsmTransferException(OsmTransferException e)Explains anOsmTransferExceptionto the user.static voidexplainPreconditionFailed(OsmApiException e)Explains an upload error due to a violated precondition, i.e.static voidexplainSecurityException(OsmTransferException e)Explains aSecurityExceptionwhich has caused anOsmTransferException.private static intshowErrorDialog(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 aSecurityExceptionwhich 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 aSocketExceptionwhich 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 aIOExceptionwhich 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 aIllegalDataExceptionwhich 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 aOfflineAccessExceptionwhich 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 aOsmApiExceptionwhich 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 aOsmApiExceptionwhich was thrown because of a bad request- Parameters:
e- the exception
-
explainNotFound
public static void explainNotFound(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because a resource wasn't found on the server- Parameters:
e- the exception
-
explainConflict
public static void explainConflict(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because of a conflict- Parameters:
e- the exception
-
explainAuthenticationFailed
public static void explainAuthenticationFailed(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because the authentication at the OSM server failed- Parameters:
e- the exception
-
explainAuthorizationFailed
public static void explainAuthorizationFailed(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because accessing a protected resource was forbidden (HTTP 403).- Parameters:
e- the exception
-
explainClientTimeout
public static void explainClientTimeout(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because of a client timeout (HTTP 408)- Parameters:
e- the exception
-
explainBandwidthLimitExceeded
public static void explainBandwidthLimitExceeded(OsmApiException e)
Explains aOsmApiExceptionwhich was thrown because of a bandwidth limit (HTTP 509)- Parameters:
e- the exception
-
explainGenericHttpException
public static void explainGenericHttpException(OsmApiException e)
Explains aOsmApiExceptionwith a generic error message.- Parameters:
e- the exception
-
explainMissingOAuthAccessTokenException
public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e)
Explains aOsmApiExceptionwhich was thrown because accessing a protected resource was forbidden.- Parameters:
e- the exception
-
explainNestedUnknownHostException
public static void explainNestedUnknownHostException(OsmTransferException e)
Explains aUnknownHostExceptionwhich 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 anOsmTransferExceptionto 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 whichOsmPrimitiveis causing the error.- Parameters:
e- the exception
-
explainException
public static void explainException(java.lang.Exception e)
Explains anExceptionto the user.- Parameters:
e- theException
-
-