Error management
This commit is contained in:
parent
bd5aa2d4d9
commit
4c9455fd76
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.application.geoportal.service.engine.providers.ucd;
|
package org.gcube.application.geoportal.service.engine.providers.ucd;
|
||||||
|
|
||||||
|
import com.mongodb.MongoServerException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||||
import org.gcube.application.cms.caches.Engine;
|
import org.gcube.application.cms.caches.Engine;
|
||||||
|
@ -191,7 +192,7 @@ public class UCDManager extends AbstractScopedMap<UCDManagerI> implements UCDMan
|
||||||
// Copying object so we don't alter live Map
|
// Copying object so we don't alter live Map
|
||||||
UseCaseDescriptor useCaseDescriptor = Serialization.convert(entry.getValue(),UseCaseDescriptor.class);
|
UseCaseDescriptor useCaseDescriptor = Serialization.convert(entry.getValue(),UseCaseDescriptor.class);
|
||||||
try {
|
try {
|
||||||
log.debug("Updateing cache with {}, mongo id is {}", useCaseDescriptor.getId(),useCaseDescriptor.getMongoId());
|
log.debug("Updating cache with {}, mongo id is {}", useCaseDescriptor.getId(),useCaseDescriptor.getMongoId());
|
||||||
if(useCaseDescriptor.getMongoId()!=null){
|
if(useCaseDescriptor.getMongoId()!=null){
|
||||||
log.warn("Retrieved UCD {} from Live Map has a Mongo id [{}]. Removing it..",useCaseDescriptor.getId(),useCaseDescriptor.getMongoId());
|
log.warn("Retrieved UCD {} from Live Map has a Mongo id [{}]. Removing it..",useCaseDescriptor.getId(),useCaseDescriptor.getMongoId());
|
||||||
useCaseDescriptor.setMongoId(null);
|
useCaseDescriptor.setMongoId(null);
|
||||||
|
@ -199,7 +200,7 @@ public class UCDManager extends AbstractScopedMap<UCDManagerI> implements UCDMan
|
||||||
// insert/update into DB
|
// insert/update into DB
|
||||||
manager.insert(useCaseDescriptor);
|
manager.insert(useCaseDescriptor);
|
||||||
memCache.put(useCaseDescriptor.getId(), useCaseDescriptor);
|
memCache.put(useCaseDescriptor.getId(), useCaseDescriptor);
|
||||||
} catch (RegistrationException e) {
|
} catch (RegistrationException | MongoServerException e) {
|
||||||
log.warn("Unable to cache UCD {}",entry.getKey(),e);
|
log.warn("Unable to cache UCD {}",entry.getKey(),e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue