Changeset 8606 in josm for trunk/src/org/openstreetmap/josm/data/cache
- Timestamp:
- 2015-07-16T21:13:12+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/cache
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java
r8510 r8606 28 28 private static final String EXPIRATION_TIME = "expirationTime"; 29 29 private static final String HTTP_RESPONSE_CODE = "httpResponceCode"; 30 private static final String ERROR_MESSAGE = "errorMessage"; 30 31 // this contains all of the above 31 32 private static final Set<String> RESERVED_KEYS = new HashSet<>(Arrays.asList(new String[]{ … … 34 35 LAST_MODIFICATION, 35 36 EXPIRATION_TIME, 36 HTTP_RESPONSE_CODE 37 HTTP_RESPONSE_CODE, 38 ERROR_MESSAGE 37 39 })); 40 38 41 39 42 /** … … 176 179 return Collections.unmodifiableMap(attrs); 177 180 } 181 182 /** 183 * @return error message returned while retrieving this object 184 */ 185 public String getErrorMessage() { 186 return attrs.get(ERROR_MESSAGE); 187 } 188 189 /** 190 * @param message error message related to this object 191 */ 192 public void setErrorMessage(String message) { 193 attrs.put(ERROR_MESSAGE, message); 194 } 178 195 } -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8604 r8606 369 369 log.log(Level.FINE, "JCS - Caching empty object as server returned 404 for: {0}", getUrl()); 370 370 attributes.setResponseCode(404); 371 attributes.setErrorMessage(e.toString()); 371 372 boolean doCache = isResponseLoadable(null, 404, null) || cacheAsEmpty(); 372 373 if (doCache) { … … 377 378 } catch (IOException e) { 378 379 log.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrl()); 379 380 attributes.setErrorMessage(e.toString()); 380 381 attributes.setResponseCode(499); // set dummy error code 381 382 boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned … … 386 387 return doCache; 387 388 } catch (Exception e) { 389 attributes.setErrorMessage(e.toString()); 388 390 log.log(Level.WARNING, "JCS - Exception during download {0}", getUrl()); 389 391 Main.warn(e);
Note:
See TracChangeset
for help on using the changeset viewer.