Added case of abort in catch exception
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@128588 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
bc2b78e472
commit
440630e953
|
@ -96,26 +96,35 @@ public class WorkspaceUploaderMng {
|
|||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
} catch (InsufficientPrivilegesException
|
||||
| ItemAlreadyExistException | InternalErrorException
|
||||
| IOException e) {
|
||||
logger.error("Error during upload: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
} catch (ItemNotFoundException | WrongItemTypeException | WorkspaceFolderNotFoundException | WrongDestinationException e) {
|
||||
logger.error("Error during overwrite: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
} catch (InsufficientPrivilegesException
|
||||
| ItemAlreadyExistException | InternalErrorException
|
||||
| IOException e) {
|
||||
logger.error("Error during upload: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
} catch (ItemNotFoundException | WrongItemTypeException | WorkspaceFolderNotFoundException | WrongDestinationException e) {
|
||||
logger.error("Error during overwrite: ",e);
|
||||
workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+". "+e.getMessage());
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
}catch(UploadCanceledException e){
|
||||
logger.info("UploadCanceledException thrown by client..");
|
||||
workspaceUploader.setStatusDescription("Aborted upload: "+itemName);
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.ABORTED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
}finally{
|
||||
try {
|
||||
// StreamUtils.deleteTempFile(uploadFile);
|
||||
|
@ -166,6 +175,15 @@ public class WorkspaceUploaderMng {
|
|||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
}catch(UploadCanceledException e){
|
||||
logger.info("UploadCanceledException thrown by client..");
|
||||
workspaceUploader.setStatusDescription("Aborted upload: "+itemName);
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.ABORTED);
|
||||
try {
|
||||
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
|
||||
} catch (Exception e1) {
|
||||
logger.error("Error during WorkspaceUploaderItem session update: ",e1);
|
||||
}
|
||||
}finally{
|
||||
try {
|
||||
// StreamUtils.deleteTempFile(uploadFile);
|
||||
|
|
Loading…
Reference in New Issue