Index: trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 1607)
+++ trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 1608)
@@ -129,6 +129,11 @@
     /**
      * Initializes this component by negotiating a protocol version with the server.
-     */
-    public void initialize() {
+     * 
+     * @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() throws UnknownHostException,SocketTimeoutException, ConnectException,Exception {
         initAuthentication();
         try {
@@ -153,5 +158,5 @@
         } catch (Exception ex) {
             initialized = false;
-            ex.printStackTrace();
+            throw ex;
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 1607)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 1608)
@@ -11,4 +11,6 @@
 import java.util.zip.InflaterInputStream;
 import java.util.zip.GZIPInputStream;
+
+import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
@@ -38,5 +40,24 @@
      */
     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: trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1607)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1608)
@@ -68,5 +68,24 @@
     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());
