added another check

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@173748 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-22 12:55:41 +00:00
parent 6a6045dd2b
commit 48d51f61ac
1 changed files with 3 additions and 4 deletions

View File

@ -101,15 +101,14 @@ public class StorageManager {
try{
iClient = client.getClient();
toSEID = iClient.getId(storageId); //to Storage Encrypted ID
logger.debug("Decoded ID"+" = "+ toSEID);
logger.info("Decoded ID"+" = "+ toSEID);
}catch(Exception e){
logger.error("Storage Client Exception when getting file from storage: ", e);
throw new InternalServerException(httpRequest, Status.INTERNAL_SERVER_ERROR, "Storage Client Exception when getting file from storage with id: "+storageId, StorageManager.class);
//throw new WebApplicationException("Storage Client Exception when getting file from storage with id: "+storageId, Status.INTERNAL_SERVER_ERROR);
}
if(toSEID==null){
logger.error("Decrypted id for storageId: "+storageId +" is null!");
if(toSEID==null || toSEID.isEmpty()){
logger.error("Decrypted id for storageId: "+storageId +" is null or empty!");
throw new WrongParameterException(httpRequest, Status.BAD_REQUEST, "Error on decrypting the "+STORAGE_ID+ " '"+storageId+"'. Is it a valid id?", StorageManager.class);
}