Improved message in case of InsufficenPrivileges
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@142310 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d23603d024
commit
b32c187dc6
|
@ -101,8 +101,7 @@ public class WorkspaceUploaderMng {
|
|||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
} catch (InternalErrorException
|
||||
| IOException e) {
|
||||
} catch (InternalErrorException | IOException e) {
|
||||
logger.error("Error during upload: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred server-side during upload: "+itemName+". "+e.getMessage() +". Try again");
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
|
@ -112,10 +111,16 @@ public class WorkspaceUploaderMng {
|
|||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
|
||||
} catch (InsufficientPrivilegesException| ItemAlreadyExistException | ItemNotFoundException | WrongItemTypeException | WorkspaceFolderNotFoundException | WrongDestinationException e) {
|
||||
logger.error("Error during overwrite: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
} catch (InsufficientPrivilegesException | ItemAlreadyExistException | ItemNotFoundException | WrongItemTypeException | WorkspaceFolderNotFoundException | WrongDestinationException e) {
|
||||
logger.error("Error during file uploading: ",e);
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
|
||||
if (e instanceof InsufficientPrivilegesException){
|
||||
String folderName = destinationFolder.getName();
|
||||
workspaceUploader.setStatusDescription("You have not permission to upload in the folder: "+folderName);
|
||||
}else{
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
}
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
|
|
Loading…
Reference in New Issue