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(Metadata.class);
|
||||
|
||||
log.warn("Initialization complete");
|
||||
// register(MoxyXmlFeature.class);
|
||||
|
||||
|
||||
|
|
|
@ -50,11 +50,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||
public class Metadata {
|
||||
|
||||
@Inject
|
||||
TemplateManager templateManager;
|
||||
private TemplateManager templateManager;
|
||||
@Inject
|
||||
GeoNetworkManager geonetworkManager;
|
||||
private GeoNetworkManager geonetworkManager;
|
||||
@Inject
|
||||
TemporaryPersistence persistence;
|
||||
private TemporaryPersistence persistence;
|
||||
|
||||
@POST
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
|
@ -151,10 +151,15 @@ public class Metadata {
|
|||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Collection<TemplateDescriptor> getList(){
|
||||
try{
|
||||
log.debug("Received LIST method");
|
||||
TemplateCollection coll= templateManager.getAvailableMetadataTemplates();
|
||||
log.debug("Gonna respond with {} ",coll);
|
||||
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
|
||||
ThreddsManager threddsManager;
|
||||
private ThreddsManager threddsManager;
|
||||
|
||||
|
||||
@PUT
|
||||
|
|
Loading…
Reference in New Issue