Fixing exception management
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@144257 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3e7084ae57
commit
26cde724ad
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue