diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ERManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ERManager.java index ad39e4f..fe18948 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ERManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ERManager.java @@ -17,7 +17,9 @@ import org.gcube.informationsystem.model.relation.ConsistsOf; import org.gcube.informationsystem.model.relation.IsRelatedTo; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; +import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetNotFoundException; +import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceAlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException; import org.gcube.informationsystem.resourceregistry.api.rest.ERPath; import org.gcube.informationsystem.resourceregistry.context.ContextUtility; @@ -60,7 +62,7 @@ public class ERManager { @Consumes({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) public String createFacet(@PathParam(TYPE_PATH_PARAM) String type, - String json) throws ResourceRegistryException { + String json) throws FacetAlreadyPresentException, ResourceRegistryException { logger.info("requested facet creation for type {} defined by {} ", type, json); FacetManagement facetManagement = new FacetManagement(); @@ -131,8 +133,7 @@ public class ERManager { @Consumes({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) public String createResource(@PathParam(TYPE_PATH_PARAM) String type, - String json) throws FacetNotFoundException, - ResourceRegistryException { + String json) throws ResourceAlreadyPresentException, ResourceRegistryException { logger.info("requested resource creation for type {} with json {}", type, json); ResourceManagement resourceManagement = new ResourceManagement(); @@ -146,7 +147,7 @@ public class ERManager { @Consumes({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON }) @Produces(MediaType.APPLICATION_JSON) public String updateResource(@PathParam(ID_PATH_PARAM) String uuid, - String json) throws FacetNotFoundException, + String json) throws ResourceNotFoundException, ResourceRegistryException { logger.info("requested resource update for id {} with {}", uuid, json); ResourceManagement resourceManagement = new ResourceManagement();