simply changed the excpetion returned

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@174079 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-11-09 13:34:33 +00:00
parent 381c5dea20
commit 70b7ec36fa
3 changed files with 5 additions and 5 deletions

View File

@ -119,7 +119,7 @@ public class CatalogueResolver {
}
if(fullScope==null)
ExceptionManager.throwWrongParameterException(req, "The scope '"+scope+"' does not matching any scope in the infrastructure. Is it valid?", this.getClass(), helpURI);
ExceptionManager.throwNotFoundException(req, "The scope '"+scope+"' does not matching any scope in the infrastructure. Is it valid?", this.getClass(), helpURI);
ResourceCatalogueCodes rc = ResourceCatalogueCodes.valueOfCodeValue(jsonRequest.getEntity_context());
if(rc==null){

View File

@ -104,12 +104,12 @@ public class StorageIDResolver {
logger.info("Decoded ID"+" = "+ toSEID);
}catch(Exception e){
logger.error("Storage Client Exception when getting file from storage: ", e);
ExceptionManager.throwBadRequestException(httpRequest, "Storage Client Exception when getting file from storage with id: "+storageId, StorageIDResolver.class, help);
ExceptionManager.throwNotFoundException(httpRequest, "Storage Client Exception when getting file from storage with id: "+storageId, StorageIDResolver.class, help);
}
if(toSEID==null || toSEID.isEmpty()){
logger.error("Decrypted id for storageId: "+storageId +" is null or empty!");
ExceptionManager.throwWrongParameterException(httpRequest, "Error on decrypting the "+STORAGE_ID+ " '"+storageId+"'. Is it a valid id?", StorageIDResolver.class, help);
ExceptionManager.throwNotFoundException(httpRequest, "Error on decrypting the "+STORAGE_ID+ " '"+storageId+"'. Is it a valid id?", StorageIDResolver.class, help);
}
long size = iClient.getSize().RFileById(toSEID);
@ -205,7 +205,7 @@ public class StorageIDResolver {
if(toSEID==null || toSEID.isEmpty()){
logger.error("Decrypted id for storageId: "+storageId +" is null or empty!");
ExceptionManager.throwWrongParameterException(httpRequest, "Error on decrypting the "+STORAGE_ID+ " '"+storageId+"'. Is it a valid id?", StorageIDResolver.class, help);
ExceptionManager.throwNotFoundException(httpRequest, "Error on decrypting the "+STORAGE_ID+ " '"+storageId+"'. Is it a valid id?", StorageIDResolver.class, help);
}

View File

@ -52,7 +52,7 @@ public class ExceptionManager {
public static void throwBadRequestException(HttpServletRequest httpRequest, String errorMessage, Class thrownBy, String helpURI){
URI theURI = checkURI(helpURI);
throw new BadRequestException(httpRequest, Status.NOT_ACCEPTABLE, errorMessage, thrownBy, theURI);
throw new BadRequestException(httpRequest, Status.BAD_REQUEST, errorMessage, thrownBy, theURI);
}