Ignore:
Timestamp:
2018-10-09T20:04:07+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16824 - better display of WMS errors

File:
1 edited

Legend:

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

    r14273 r14311  
    360360                        String data = urlConn.fetchContent();
    361361                        if (!data.isEmpty()) {
    362                             Matcher m = HttpClient.getTomcatErrorMatcher(data);
    363                             if (m.matches()) {
    364                                 attributes.setErrorMessage(m.group(1).replace("'", "''"));
     362                            String detectErrorMessage = detectErrorMessage(data);
     363                            if (detectErrorMessage != null) {
     364                                attributes.setErrorMessage(detectErrorMessage);
    365365                            }
    366366                        }
     
    418418        Logging.warn("JCS - Silent failure during download: {0}", getUrlNoException());
    419419        return false;
     420    }
     421
     422    protected String detectErrorMessage(String data) {
     423        Matcher m = HttpClient.getTomcatErrorMatcher(data);
     424        return m.matches() ? m.group(1).replace("'", "''") : null;
    420425    }
    421426
Note: See TracChangeset for help on using the changeset viewer.