Ignore:
Timestamp:
2016-06-24T01:27:35+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1166 - Exception handlers should preserve the original exceptions

Location:
trunk/src/org/openstreetmap/josm/data/cache
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java

    r10378 r10469  
    188188
    189189    /**
     190     * @param error error related to this object
     191     * @since 10469
     192     */
     193    public void setError(Exception error) {
     194        setErrorMessage(Main.getErrorMessage(error));
     195    }
     196
     197    /**
    190198     * @param message error message related to this object
    191199     */
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r10408 r10469  
    378378            log.log(Level.FINE, "JCS - Caching empty object as server returned 404 for: {0}", getUrlNoException());
    379379            attributes.setResponseCode(404);
    380             attributes.setErrorMessage(e.toString());
     380            attributes.setError(e);
    381381            boolean doCache = isResponseLoadable(null, 404, null) || cacheAsEmpty();
    382382            if (doCache) {
     
    387387        } catch (IOException e) {
    388388            log.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrlNoException());
    389             attributes.setErrorMessage(e.toString());
     389            attributes.setError(e);
    390390            attributes.setResponseCode(499); // set dummy error code
    391391            boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned
     
    396396            return doCache;
    397397        } catch (InterruptedException e) {
    398             attributes.setErrorMessage(e.toString());
     398            attributes.setError(e);
    399399            log.log(Level.WARNING, "JCS - Exception during download {0}", getUrlNoException());
    400400            Main.warn(e);
Note: See TracChangeset for help on using the changeset viewer.