Index: trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 2861)
+++ trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 2862)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.ChangesetClosedException;
+import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
 import org.openstreetmap.josm.io.OsmApiException;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
@@ -269,4 +270,20 @@
 
     /**
+     * Explains a {@see OsmApiException} which was thrown because accessing a protected
+     * resource was forbidden.
+     *
+     * @param e the exception
+     */
+    public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
+        HelpAwareOptionPane.showOptionDialog(
+                Main.parent,
+                ExceptionUtil.explainMissingOAuthAccessTokenException(e),
+                tr("Authenticationi failed"),
+                JOptionPane.ERROR_MESSAGE,
+                ht("/ErrorMessages#MissingOAuthAccessToken")
+        );
+    }
+
+    /**
      * Explains a {@see UnknownHostException} which has caused an {@see OsmTransferException}.
      * This is most likely happening when there is an error in the API URL or when
@@ -340,4 +357,9 @@
         }
 
+        if (e instanceof MissingOAuthAccessTokenException) {
+            explainMissingOAuthAccessTokenException((MissingOAuthAccessTokenException)e);
+            return;
+        }
+
         if (e instanceof OsmApiException) {
             OsmApiException oae = (OsmApiException) e;
@@ -368,6 +390,6 @@
                 return;
             }
-            explainGeneric(e);
-        }
+        }
+        explainGeneric(e);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 2861)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 2862)
@@ -228,5 +228,5 @@
     @Override protected void realRun() throws SAXException, IOException {
         try {
-            uploadloop: while(true) {
+            uploadloop:while(true) {
                 try {
                     getProgressMonitor().subTask(tr("Uploading {0} objects ...", toUpload.getSize()));
@@ -241,4 +241,5 @@
                     break;
                 } catch(OsmTransferCancelledException e) {
+                    e.printStackTrace();
                     uploadCancelled = true;
                     return;
@@ -343,5 +344,4 @@
                     handleFailedUpload(lastException);
                 }
-
             }
         };
Index: trunk/src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java	(revision 2862)
+++ trunk/src/org/openstreetmap/josm/io/MissingOAuthAccessTokenException.java	(revision 2862)
@@ -0,0 +1,21 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+
+public class MissingOAuthAccessTokenException extends OsmTransferException{
+    public MissingOAuthAccessTokenException() {
+        super();
+    }
+
+    public MissingOAuthAccessTokenException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public MissingOAuthAccessTokenException(String message) {
+        super(message);
+    }
+
+    public MissingOAuthAccessTokenException(Throwable cause) {
+        super(cause);
+    }
+}
Index: trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 2861)
+++ trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 2862)
@@ -118,6 +118,5 @@
         OAuthAccessTokenHolder holder = OAuthAccessTokenHolder.getInstance();
         if (! holder.containsAccessToken())
-            throw new OsmTransferException(tr("Failed to add an OAuth authentication header. There is currently no OAuth Access Token configured."));
-
+            throw new MissingOAuthAccessTokenException();
         consumer.setTokenWithSecret(holder.getAccessTokenKey(), holder.getAccessTokenSecret());
         try {
Index: trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 2861)
+++ trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 2862)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.io.ChangesetClosedException;
+import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmApiException;
@@ -41,4 +42,23 @@
                 + "Check the server URL in your preferences and your internet connection.</html>", Main.pref.get(
                         "osm-server.url", "http://api.openstreetmap.org/api"));
+        return msg;
+    }
+
+
+    /**
+     *  Creates the error message
+     *
+     * @param e the exception
+     */
+    public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
+        e.printStackTrace();
+        String msg = tr(
+                "<html>Failed to authenticate at the OSM server ''{0}''.<br>"
+                + "You are using OAuth to authenticate but currently there is no<br>"
+                + "OAuth Access Token configured.<br>"
+                + "Please open the Preferences Dialog and generate or enter an Access Token."
+                + "</html>",
+                Main.pref.get("osm-server.url", "http://api.openstreetmap.org/api")
+        );
         return msg;
     }
