[vsc] annotate: rethrow PCE to let ProgressManager handle it

This commit is contained in:
Kirill Likhodedov
2015-09-23 16:52:13 +03:00
parent d0f5f84d6f
commit 9e95a9a1c4
2 changed files with 8 additions and 0 deletions
@@ -26,6 +26,7 @@ import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.localVcs.UpToDateLineNumberProvider;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
@@ -193,6 +194,9 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
catch (VcsException e) {
exceptionRef.set(e);
}
catch (ProcessCanceledException pce) {
throw pce;
}
catch (Throwable t) {
exceptionRef.set(new VcsException(t));
}
@@ -17,6 +17,7 @@ package git4idea.annotate;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
@@ -87,6 +88,9 @@ public class GitAnnotationProvider implements AnnotationProviderEx, VcsCacheable
final GitFileAnnotation result = annotate(realFilePath, revisionNumber, revisions, file);
annotation[0] = result;
}
catch (ProcessCanceledException pce) {
throw pce;
}
catch (Exception e) {
exception[0] = e;
}