Changeset 14268 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2018-09-22T00:00:37+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r14214 r14268 181 181 int httpStatusCode = attributes.getResponseCode(); 182 182 if (httpStatusCode >= 400 && !isNoTileAtZoom()) { 183 if (attributes.getErrorMessage() == null) {184 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode));185 } else {186 tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage()));187 }188 183 status = false; 184 handleError(attributes); 189 185 } 190 186 } … … 192 188 break; 193 189 case FAILURE: 194 tile.setError("Problem loading tile");190 handleError(attributes); 195 191 tryLoadTileImage(object); 196 192 break; … … 215 211 } 216 212 } 213 } 214 } 215 216 private void handleError(CacheEntryAttributes attributes) { 217 if (attributes != null) { 218 int httpStatusCode = attributes.getResponseCode(); 219 if (attributes.getErrorMessage() == null) { 220 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode)); 221 } else { 222 tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage())); 223 } 224 if (httpStatusCode >= 500 && httpStatusCode != 599) { 225 // httpStatusCode = 599 is set by JCSCachedTileLoaderJob on IOException 226 tile.setLoaded(false); // treat 500 errors as temporary and try to load it again 227 } 228 } else { 229 tile.setError(tr("Problem loading tile")); 230 // treat unknown errors as permanent and do not try to load tile again 217 231 } 218 232 }
Note:
See TracChangeset
for help on using the changeset viewer.