Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/DownloadAndOpenTaskAttachmentJob.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/DownloadAndOpenTaskAttachmentJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/DownloadAndOpenTaskAttachmentJob.java
index 59fa8575c..96dc681c9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/DownloadAndOpenTaskAttachmentJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/DownloadAndOpenTaskAttachmentJob.java
@@ -55,9 +55,13 @@ class DownloadAndOpenTaskAttachmentJob implements ICoreRunnable {
public void run(IProgressMonitor monitor) throws CoreException {
monitor.beginTask(jobName, IProgressMonitor.UNKNOWN);
- IStatus result = execute(new SubProgressMonitor(monitor, 100));
- if (result != null && !result.isOK()) {
- throw new CoreException(result);
+ try {
+ IStatus result = execute(new SubProgressMonitor(monitor, 100));
+ if (result != null && !result.isOK()) {
+ throw new CoreException(result);
+ }
+ } finally {
+ monitor.done();
}
}
@@ -89,12 +93,10 @@ class DownloadAndOpenTaskAttachmentJob implements ICoreRunnable {
} catch (CoreException e) {
int s = IStatus.ERROR;
if (e.getStatus() != null && e.getStatus().getCode() == IStatus.CANCEL) {
- s = IStatus.CANCEL;
+ throw new OperationCanceledException();
}
return new Status(s, TasksUiPlugin.ID_PLUGIN,
Messages.DownloadAndOpenTaskAttachmentJob_failedToDownloadAttachment, e);
- } catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
} finally {
// (fos != null) only when there is some problem, in other cases we nulled fos already
if (fos != null) {

Back to the top