From a95d369ba2f3ee52e113179305fdb60107747d57 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Wed, 29 Mar 2017 15:02:02 +0000 Subject: [PATCH] Fixed exception management git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@146436 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../resourceregistry/er/ERManagement.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java index 2e9009c..4556835 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java @@ -92,9 +92,6 @@ public abstract class ERManagement { protected Class elementClass; protected AccessType accessType; - //protected Class erTypeClass; - //protected String baseType; - protected OrientGraph orientGraph; protected UUID uuid; @@ -346,13 +343,17 @@ public abstract class ERManagement { throws ERNotFoundException { switch (accessType) { + case RESOURCE: throw new ResourceNotFoundException(e); case FACET: throw new FacetNotFoundException(e); - case RELATION: + case IS_RELATED_TO: + throw new RelationNotFoundException(e); + + case CONSISTS_OF: throw new RelationNotFoundException(e); default: @@ -373,9 +374,12 @@ public abstract class ERManagement { case FACET: throw new FacetAvailableInAnotherContextException(e); - case RELATION: + case IS_RELATED_TO: throw new RelationAvailableInAnotherContextException(e); + case CONSISTS_OF: + throw new RelationAvailableInAnotherContextException(e); + default: break; }