Index: src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmApi.java	(revision 1605)
+++ src/org/openstreetmap/josm/io/OsmApi.java	(working copy)
@@ -128,8 +128,13 @@
 
     /**
      * Initializes this component by negotiating a protocol version with the server.
+     * 
+     * @exception UnknownHostException thrown, if the API host is unknown
+     * @exception SocketTimeoutException thrown, if the connection to the API host  times out
+     * @exception ConnectException throw, if the connection to the API host fails 
+     * @exception Exception any other exception 
      */
-    public void initialize() {
+    public void initialize() throws UnknownHostException,SocketTimeoutException, ConnectException,Exception {
         initAuthentication();
         try {
             initialized = true; // note: has to be before the sendRequest or that will throw!
@@ -152,7 +157,7 @@
             osmWriter.setVersion(version);
         } catch (Exception ex) {
             initialized = false;
-            ex.printStackTrace();
+            throw ex;
         }
     }
 
Index: src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 1605)
+++ src/org/openstreetmap/josm/io/OsmServerReader.java	(working copy)
@@ -11,6 +11,8 @@
 import java.util.zip.InflaterInputStream;
 import java.util.zip.GZIPInputStream;
 
+import javax.swing.JOptionPane;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.PleaseWaitDialog;
@@ -37,7 +39,26 @@
      * @return An reader reading the input stream (servers answer) or <code>null</code>.
      */
     protected InputStream getInputStream(String urlStr, PleaseWaitDialog pleaseWaitDlg) throws IOException {
-        api.initialize();
+       
+        // initialize API. Abort download in case of configuration or network
+        // errors
+        //
+        try {
+            api.initialize();
+        } catch(Exception e) {
+            JOptionPane.showMessageDialog(
+                null,
+                tr(   "Failed to initialize communication with the OSM server {0}.\n"
+                    + "Check the server URL in your preferences and your internet connection.",
+                    Main.pref.get("osm-server.url")
+                ),
+                tr("Error"),
+                JOptionPane.ERROR_MESSAGE
+            );
+            e.printStackTrace();
+            return null;
+        }
+
         urlStr = api.getBaseUrl() + urlStr;
         return getInputStreamRaw(urlStr, pleaseWaitDlg);
     }
Index: src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1605)
+++ src/org/openstreetmap/josm/io/OsmServerWriter.java	(working copy)
@@ -67,7 +67,26 @@
      */
     public void uploadOsm(String the_version, Collection<OsmPrimitive> list) {
         processed = new LinkedList<OsmPrimitive>();
-        api.initialize();
+        
+        // initialize API. Abort upload in case of configuration or network
+        // errors
+        //
+        try {
+            api.initialize();
+        } catch(Exception e) {
+            JOptionPane.showMessageDialog(
+                null,
+                tr(   "Failed to initialize communication with the OSM server {0}.\n"
+                    + "Check the server URL in your preferences and your internet connection.",
+                    Main.pref.get("osm-server.url")
+                ),
+                tr("Error"),
+                JOptionPane.ERROR_MESSAGE
+            );
+            e.printStackTrace();
+            return;
+        }
+        
 
         Main.pleaseWaitDlg.progress.setMaximum(list.size());
         Main.pleaseWaitDlg.progress.setValue(0);
