Changeset 14268 in josm
- Timestamp:
- 2018-09-22T00:00:37+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 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 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r14260 r14268 303 303 tile.setImage(null); 304 304 } 305 tile.setLoaded(success);306 305 invalidateLater(); 307 306 Logging.debug("tileLoadingFinished() tile: {0} success: {1}", tile, success); … … 461 460 } 462 461 } 462 content.add(Arrays.asList(tr("Status:"), tr(tile.getStatus()))); 463 content.add(Arrays.asList(tr("Loaded:"), tr(Boolean.toString(tile.isLoaded())))); 464 content.add(Arrays.asList(tr("Loading:"), tr(Boolean.toString(tile.isLoading())))); 465 content.add(Arrays.asList(tr("Error:"), tr(Boolean.toString(tile.hasError())))); 463 466 for (List<String> entry: content) { 464 467 panel.add(new JLabel(entry.get(0) + ':'), GBC.std()); … … 889 892 if (tile == null) 890 893 return false; 891 if (!force && (tile.isLoaded() || tile.hasError()))894 if (!force && tile.isLoaded()) 892 895 return false; 893 896 if (tile.isLoading())
Note:
See TracChangeset
for help on using the changeset viewer.