improved exception
This commit is contained in:
parent
70558e9f8b
commit
e2f9b075fa
|
@ -31,6 +31,7 @@ import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
|||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.datatransfer.resolver.requesthandler.RequestHandler;
|
||||
import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
|
||||
import org.gcube.datatransfer.resolver.services.exceptions.NotFoundException;
|
||||
import org.gcube.datatransfer.resolver.util.Util;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
|
@ -233,7 +234,8 @@ public class WekeoResolver {
|
|||
if(toReturn.size()==0){
|
||||
String errorMessage = String.format("Missing the RR with Name '%s' and Category '%s' in the scope '%s'. Please contact the support.",RUNTIME_WKEO_RESOURCE_NAME,CATEGORY_WEKEO_TYPE,ScopeProvider.instance.get());
|
||||
logger.error(errorMessage);
|
||||
throw ExceptionManager.internalErrorException(req, errorMessage, WekeoResolver.class, helpURI);
|
||||
throw ExceptionManager.notFoundException(req, errorMessage, WekeoResolver.class, helpURI);
|
||||
|
||||
}
|
||||
|
||||
String wekeoUsername = null;
|
||||
|
@ -253,6 +255,10 @@ public class WekeoResolver {
|
|||
return null;
|
||||
|
||||
}catch(Exception e){
|
||||
|
||||
if(e instanceof NotFoundException)
|
||||
throw e;
|
||||
|
||||
String errorMessage = "Error occurred on reading the "+RUNTIME_WKEO_RESOURCE_NAME+" SE registered in the scope: "+ScopeProvider.instance.get();
|
||||
logger.error(errorMessage, e);
|
||||
throw ExceptionManager.internalErrorException(req, errorMessage, WekeoResolver.class, helpURI);
|
||||
|
|
Loading…
Reference in New Issue