Index: trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java	(revision 8604)
+++ trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java	(revision 8606)
@@ -28,4 +28,5 @@
     private static final String EXPIRATION_TIME = "expirationTime";
     private static final String HTTP_RESPONSE_CODE = "httpResponceCode";
+    private static final String ERROR_MESSAGE = "errorMessage";
     // this contains all of the above
     private static final Set<String> RESERVED_KEYS = new HashSet<>(Arrays.asList(new String[]{
@@ -34,6 +35,8 @@
         LAST_MODIFICATION,
         EXPIRATION_TIME,
-        HTTP_RESPONSE_CODE
+        HTTP_RESPONSE_CODE,
+        ERROR_MESSAGE
     }));
+
 
     /**
@@ -176,3 +179,17 @@
         return Collections.unmodifiableMap(attrs);
     }
+
+    /**
+     * @return error message returned while retrieving this object
+     */
+    public String getErrorMessage() {
+        return attrs.get(ERROR_MESSAGE);
+    }
+
+    /**
+     * @param message error message related to this object
+     */
+    public void setErrorMessage(String message) {
+        attrs.put(ERROR_MESSAGE, message);
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 8604)
+++ trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 8606)
@@ -369,4 +369,5 @@
             log.log(Level.FINE, "JCS - Caching empty object as server returned 404 for: {0}", getUrl());
             attributes.setResponseCode(404);
+            attributes.setErrorMessage(e.toString());
             boolean doCache = isResponseLoadable(null, 404, null) || cacheAsEmpty();
             if (doCache) {
@@ -377,5 +378,5 @@
         } catch (IOException e) {
             log.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrl());
-
+            attributes.setErrorMessage(e.toString());
             attributes.setResponseCode(499); // set dummy error code
             boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned
@@ -386,4 +387,5 @@
             return doCache;
         } catch (Exception e) {
+            attributes.setErrorMessage(e.toString());
             log.log(Level.WARNING, "JCS - Exception during download {0}",  getUrl());
             Main.warn(e);
Index: trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 8604)
+++ trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 8606)
@@ -188,6 +188,10 @@
                     }
                     int httpStatusCode = attributes.getResponseCode();
-                    if (!isNoTileAtZoom() && httpStatusCode >= 400) {
-                        tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode));
+                    if (!isNoTileAtZoom() && httpStatusCode >= 400 && httpStatusCode != 499) {
+                        if (attributes.getErrorMessage() == null) {
+                            tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode));
+                        } else {
+                            tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage()));
+                        }
                         status = false;
                     }
@@ -209,5 +213,5 @@
         } catch (IOException e) {
             LOG.log(Level.WARNING, "JCS TMS - error loading object for tile {0}: {1}", new Object[] {tile.getKey(), e.getMessage()});
-            tile.setError(e.getMessage());
+            tile.setError(e.toString());
             tile.setLoaded(false);
             if (listeners != null) { // listeners might be null, if some other thread notified already about success
@@ -285,6 +289,8 @@
                     tile.finishLoading();
                 }
-                if (attributes.getResponseCode() >= 400) {
+                if (attributes.getErrorMessage() == null) {
                     tile.setError(tr("HTTP error {0} when loading tiles", attributes.getResponseCode()));
+                } else {
+                    tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage()));
                 }
                 return tile;
