added only the general Exception to catch error on method uploadFile

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@179245 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-05-03 12:41:45 +00:00
parent 48c7fdaa9c
commit 7863c45c90
2 changed files with 7 additions and 15 deletions

View File

@ -428,9 +428,7 @@ public final class WorkspaceStorageHubClientService implements Workspace{
@Override
public WorkspaceItem uploadFile(
String folderId, InputStream is, String fileName, String fileDescription)
throws InsufficientPrivilegesException,
WorkspaceFolderNotFoundException, InternalErrorException,
ItemAlreadyExistException, WrongDestinationException {
throws Exception {
WorkspaceItem wsItem = null;
try {
@ -438,10 +436,8 @@ public final class WorkspaceStorageHubClientService implements Workspace{
wsItem = HLMapper.toWorkspaceItem(item);
}
catch (Exception e) {
LOGGER.error("Error during uploading the file: "+fileName+" in the folderId: "+folderId, e);
String error = e.getMessage()!=null?e.getMessage():"";
throw new InternalErrorException("Error during uploading the file: "+fileName+". "+error);
LOGGER.error("Error uploading the file: "+fileName+" in the folderId: "+folderId, e);
throw e;
}
return wsItem;

View File

@ -149,14 +149,10 @@ public interface Workspace{
* @param inputStream the input stream
* @param fileName the file name
* @param fileDescription the file description
* @return the item
* @throws InsufficientPrivilegesException the insufficient privileges exception
* @throws WorkspaceFolderNotFoundException the workspace folder not found exception
* @throws InternalErrorException the internal error exception
* @throws ItemAlreadyExistException the item already exist exception
* @throws WrongDestinationException the wrong destination exception
* @return the workspace item
* @throws Exception the exception
*/
public WorkspaceItem uploadFile(String folderId, InputStream inputStream, String fileName, String fileDescription) throws InsufficientPrivilegesException, WorkspaceFolderNotFoundException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException;
public WorkspaceItem uploadFile(String folderId, InputStream inputStream, String fileName, String fileDescription) throws Exception;
/**
* Gets the shared folder members.
@ -288,7 +284,7 @@ public interface Workspace{
public URL getPublicLinkForFile(String fileItemId) throws Exception;
/**
* Gets the public link of the file at the input version
* Gets the public link of the file at the input version.
*
* @param fileItemId the file item id
* @param version the version