Changeset 13631 in josm


Ignore:
Timestamp:
2018-04-15T14:11:59+02:00 (8 months ago)
Author:
Don-vip
Message:

see #16129 - better catch of WMS ServiceExceptions

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r13449 r13631  
    3535import org.openstreetmap.josm.tools.HttpClient;
    3636import org.openstreetmap.josm.tools.Logging;
     37import org.openstreetmap.josm.tools.Utils;
    3738
    3839/**
     
    4546    private static final LongProperty MAXIMUM_EXPIRES = new LongProperty("imagery.generic.maximum_expires", TimeUnit.DAYS.toMillis(30));
    4647    private static final LongProperty MINIMUM_EXPIRES = new LongProperty("imagery.generic.minimum_expires", TimeUnit.HOURS.toMillis(1));
    47     private static final Pattern SERVICE_EXCEPTION_PATTERN = Pattern.compile("(?s).+<ServiceException>(.+)</ServiceException>.+");
     48    static final Pattern SERVICE_EXCEPTION_PATTERN = Pattern.compile("(?s).+<ServiceException[^>]*>(.+)</ServiceException>.+");
    4849    protected final Tile tile;
    4950    private volatile URL url;
     
    280281                        Matcher m = SERVICE_EXCEPTION_PATTERN.matcher(s);
    281282                        if (m.matches()) {
    282                             tile.setError(m.group(1));
    283                             Logging.error(m.group(1));
     283                            String message = Utils.strip(m.group(1));
     284                            tile.setError(message);
     285                            Logging.error(message);
    284286                            Logging.debug(s);
    285287                        } else {
Note: See TracChangeset for help on using the changeset viewer.