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:
parent
381c5dea20
commit
70b7ec36fa
|
@ -119,7 +119,7 @@ public class CatalogueResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fullScope==null)
|
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());
|
ResourceCatalogueCodes rc = ResourceCatalogueCodes.valueOfCodeValue(jsonRequest.getEntity_context());
|
||||||
if(rc==null){
|
if(rc==null){
|
||||||
|
|
|
@ -104,12 +104,12 @@ public class StorageIDResolver {
|
||||||
logger.info("Decoded ID"+" = "+ toSEID);
|
logger.info("Decoded ID"+" = "+ toSEID);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Storage Client Exception when getting file from storage: ", 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()){
|
if(toSEID==null || toSEID.isEmpty()){
|
||||||
logger.error("Decrypted id for storageId: "+storageId +" is null or empty!");
|
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);
|
long size = iClient.getSize().RFileById(toSEID);
|
||||||
|
@ -205,7 +205,7 @@ public class StorageIDResolver {
|
||||||
|
|
||||||
if(toSEID==null || toSEID.isEmpty()){
|
if(toSEID==null || toSEID.isEmpty()){
|
||||||
logger.error("Decrypted id for storageId: "+storageId +" is null or empty!");
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class ExceptionManager {
|
||||||
public static void throwBadRequestException(HttpServletRequest httpRequest, String errorMessage, Class thrownBy, String helpURI){
|
public static void throwBadRequestException(HttpServletRequest httpRequest, String errorMessage, Class thrownBy, String helpURI){
|
||||||
|
|
||||||
URI theURI = checkURI(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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue