Index: /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 14339)
+++ /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 14340)
@@ -42,4 +42,14 @@
     }
 
+    private static int showErrorDialog(String msg, String title, String helpTopic) {
+        return HelpAwareOptionPane.showOptionDialog(
+                MainApplication.getMainFrame(),
+                new HtmlPanel(msg),
+                title,
+                JOptionPane.ERROR_MESSAGE,
+                helpTopic
+        );
+    }
+
     /**
      * handles an exception caught during OSM API initialization
@@ -48,9 +58,7 @@
      */
     public static void explainOsmApiInitializationException(OsmApiInitializationException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainOsmApiInitializationException(e),
                 tr("Error"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#OsmApiInitializationException")
         );
@@ -63,9 +71,7 @@
      */
     public static void explainChangesetClosedException(ChangesetClosedException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainChangesetClosedException(e),
                 tr("Error"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/Action/Upload#ChangesetClosed")
         );
@@ -78,9 +84,7 @@
      */
     public static void explainPreconditionFailed(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainPreconditionFailed(e),
                 tr("Precondition violation"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#OsmApiException")
         );
@@ -104,11 +108,8 @@
      * @param e the exception
      */
-
     public static void explainSecurityException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainSecurityException(e),
                 tr("Security exception"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#SecurityException")
         );
@@ -122,11 +123,8 @@
      * @param e the exception
      */
-
     public static void explainNestedSocketException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainNestedSocketException(e),
                 tr("Network exception"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#NestedSocketException")
         );
@@ -140,11 +138,8 @@
      * @param e the exception
      */
-
     public static void explainNestedIOException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainNestedIOException(e),
                 tr("IO Exception"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#NestedIOException")
         );
@@ -158,9 +153,7 @@
      */
     public static void explainNestedIllegalDataException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainNestedIllegalDataException(e),
                 tr("Illegal Data"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#IllegalDataException")
         );
@@ -175,9 +168,7 @@
      */
     public static void explainNestedOfflineAccessException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainOfflineAccessException(e),
                 tr("Offline mode"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#OfflineAccessException")
         );
@@ -203,11 +194,8 @@
      * @param e the exception
      */
-
     public static void explainInternalServerError(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainInternalServerError(e),
                 tr("Internal Server Error"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#InternalServerError")
         );
@@ -221,9 +209,7 @@
      */
     public static void explainBadRequest(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainBadRequest(e),
                 tr("Bad Request"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#BadRequest")
         );
@@ -237,9 +223,7 @@
      */
     public static void explainNotFound(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainNotFound(e),
                 tr("Not Found"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#NotFound")
         );
@@ -252,9 +236,7 @@
      */
     public static void explainConflict(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainConflict(e),
                 tr("Conflict"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#Conflict")
         );
@@ -275,9 +257,7 @@
         }
 
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 msg,
                 tr("Authentication failed"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#AuthenticationFailed")
         );
@@ -312,9 +292,7 @@
         }
 
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 msg,
                 tr("Authorisation Failed"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#AuthorizationFailed")
         );
@@ -328,9 +306,7 @@
      */
     public static void explainClientTimeout(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainClientTimeout(e),
                 tr("Client Time Out"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#ClientTimeOut")
         );
@@ -344,9 +320,7 @@
      */
     public static void explainBandwidthLimitExceeded(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainBandwidthLimitExceeded(e),
                 tr("Bandwidth Limit Exceeded"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#BandwidthLimit")
         );
@@ -382,9 +356,7 @@
      */
     public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainMissingOAuthAccessTokenException(e),
                 tr("Authentication failed"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#MissingOAuthAccessToken")
         );
@@ -399,9 +371,7 @@
      */
     public static void explainNestedUnkonwnHostException(OsmTransferException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainNestedUnknownHostException(e),
                 tr("Unknown host"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#UnknownHost")
         );
@@ -502,9 +472,7 @@
      */
     public static void explainGoneForUnknownPrimitive(OsmApiException e) {
-        HelpAwareOptionPane.showOptionDialog(
-                MainApplication.getMainFrame(),
+        showErrorDialog(
                 ExceptionUtil.explainGoneForUnknownPrimitive(e),
                 tr("Object deleted"),
-                JOptionPane.ERROR_MESSAGE,
                 ht("/ErrorMessages#GoneForUnknownPrimitive")
         );
