Enforcing fail management
This commit is contained in:
parent
0e26e2c75d
commit
2aac7299a8
|
@ -90,6 +90,7 @@ public class SDIService extends ResourceConfig{
|
||||||
registerClasses(Thredds.class);
|
registerClasses(Thredds.class);
|
||||||
registerClasses(Metadata.class);
|
registerClasses(Metadata.class);
|
||||||
|
|
||||||
|
log.warn("Initialization complete");
|
||||||
// register(MoxyXmlFeature.class);
|
// register(MoxyXmlFeature.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
public class Metadata {
|
public class Metadata {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
TemplateManager templateManager;
|
private TemplateManager templateManager;
|
||||||
@Inject
|
@Inject
|
||||||
GeoNetworkManager geonetworkManager;
|
private GeoNetworkManager geonetworkManager;
|
||||||
@Inject
|
@Inject
|
||||||
TemporaryPersistence persistence;
|
private TemporaryPersistence persistence;
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||||
|
@ -151,10 +151,15 @@ public class Metadata {
|
||||||
@Path("/list")
|
@Path("/list")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Collection<TemplateDescriptor> getList(){
|
public Collection<TemplateDescriptor> getList(){
|
||||||
|
try{
|
||||||
log.debug("Received LIST method");
|
log.debug("Received LIST method");
|
||||||
TemplateCollection coll= templateManager.getAvailableMetadataTemplates();
|
TemplateCollection coll= templateManager.getAvailableMetadataTemplates();
|
||||||
log.debug("Gonna respond with {} ",coll);
|
log.debug("Gonna respond with {} ",coll);
|
||||||
return coll.getAvailableTemplates();
|
return coll.getAvailableTemplates();
|
||||||
|
}catch(Throwable e ){
|
||||||
|
log.warn("Unexpected error while getting templates",e);
|
||||||
|
throw new WebApplicationException("Unabel to publish metadata. Cause "+e.getMessage(),Status.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class Thredds {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ThreddsManager threddsManager;
|
private ThreddsManager threddsManager;
|
||||||
|
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
|
|
Loading…
Reference in New Issue