Fixed exception management

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@146436 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-03-29 15:02:02 +00:00
parent 290ce6ac90
commit a95d369ba2
1 changed files with 9 additions and 5 deletions

View File

@ -92,9 +92,6 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
protected Class<El> elementClass; protected Class<El> elementClass;
protected AccessType accessType; protected AccessType accessType;
//protected Class<ERType> erTypeClass;
//protected String baseType;
protected OrientGraph orientGraph; protected OrientGraph orientGraph;
protected UUID uuid; protected UUID uuid;
@ -346,13 +343,17 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
throws ERNotFoundException { throws ERNotFoundException {
switch (accessType) { switch (accessType) {
case RESOURCE: case RESOURCE:
throw new ResourceNotFoundException(e); throw new ResourceNotFoundException(e);
case FACET: case FACET:
throw new FacetNotFoundException(e); throw new FacetNotFoundException(e);
case RELATION: case IS_RELATED_TO:
throw new RelationNotFoundException(e);
case CONSISTS_OF:
throw new RelationNotFoundException(e); throw new RelationNotFoundException(e);
default: default:
@ -373,9 +374,12 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
case FACET: case FACET:
throw new FacetAvailableInAnotherContextException(e); throw new FacetAvailableInAnotherContextException(e);
case RELATION: case IS_RELATED_TO:
throw new RelationAvailableInAnotherContextException(e); throw new RelationAvailableInAnotherContextException(e);
case CONSISTS_OF:
throw new RelationAvailableInAnotherContextException(e);
default: default:
break; break;
} }