Refactoring service due to exception reoganization in resource-registry-api
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@135001 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1399e48456
commit
a576d3d8fa
|
@ -8,7 +8,7 @@ import javax.ws.rs.ext.Provider;
|
||||||
|
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.InternalException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.InternalException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotAllowedException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotAllowedException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ObjectNotFound;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ElementNotFound;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ public class ResourceRegistryExceptionMapper implements ExceptionMapper<Resource
|
||||||
String entity = exception.getMessage();
|
String entity = exception.getMessage();
|
||||||
MediaType mediaType = MediaType.TEXT_PLAIN_TYPE;
|
MediaType mediaType = MediaType.TEXT_PLAIN_TYPE;
|
||||||
|
|
||||||
if(ObjectNotFound.class.isAssignableFrom(exception.getClass())){
|
if(ElementNotFound.class.isAssignableFrom(exception.getClass())){
|
||||||
status = Status.NOT_FOUND;
|
status = Status.NOT_FOUND;
|
||||||
}else if(NotAllowedException.class.isAssignableFrom(exception.getClass())){
|
}else if(NotAllowedException.class.isAssignableFrom(exception.getClass())){
|
||||||
status = Status.FORBIDDEN;
|
status = Status.FORBIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue