Skip to content

Commit

Permalink
Merge pull request #1034 from ZakarFin/handle-caps-error
Browse files Browse the repository at this point in the history
Handle non-fatal error with capabilities during migrations
  • Loading branch information
ZakarFin authored Dec 1, 2023
2 parents 3bcfbcf + 2088d81 commit 5918465
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import fi.nls.oskari.map.style.VectorStyleService;
import fi.nls.oskari.service.OskariComponentManager;
import fi.nls.oskari.service.ServiceException;
import fi.nls.oskari.service.ServiceRuntimeException;
import fi.nls.oskari.util.IOHelper;
import fi.nls.oskari.util.OskariRuntimeException;
import org.oskari.admin.LayerCapabilitiesHelper;
Expand Down Expand Up @@ -55,11 +56,11 @@ public static int setupLayer(final String layerfile) throws IOException {
// add info from capabilities if not from localhost (this is usually called when server starting == localhost doesn't work properly)
try {
LayerCapabilitiesHelper.updateCapabilities(oskariLayer);
} catch (ServiceException e) {
} catch (ServiceException | ServiceRuntimeException e) {
log.warn(e,"Error updating capabilities for service from", oskariLayer.getUrl());
if (OskariLayer.TYPE_WMTS.equals(oskariLayer.getType())) {
log.warn("The WMTS-layer", oskariLayer.getName(),
"might work slower than normal with capabilities/tilegrids not cached. Try caching the capabilities later using the admin UI.");
"might not work properly without capabilities/tilegrids. Try refreshing the capabilities later using the admin UI.");
}
}
}
Expand Down

0 comments on commit 5918465

Please sign in to comment.