Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Chen2012-06-20 08:28:48 +0000
committerWilliam Chen2012-06-20 08:28:48 +0000
commita40131fce73718f23454afa639cfc893282ae650 (patch)
tree9f984282912e3d1bcf089bbf36703f330841e5f9 /target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui
parentf040254c9a2a5c017060cad50f3a6df8bbe09c63 (diff)
downloadorg.eclipse.tcf-a40131fce73718f23454afa639cfc893282ae650.tar.gz
org.eclipse.tcf-a40131fce73718f23454afa639cfc893282ae650.tar.xz
org.eclipse.tcf-a40131fce73718f23454afa639cfc893282ae650.zip
Target Explorer: Add a severity field to TCFException to differentiate
the error handling.
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/operations/UiExecutor.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/operations/UiExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/operations/UiExecutor.java
index f6d76670b..3f89aeb7a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/operations/UiExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/operations/UiExecutor.java
@@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IOperation;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFException;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.TimeTriggeredProgressMonitorDialog;
@@ -79,9 +80,15 @@ public class UiExecutor implements IOpExecutor {
}
catch (InvocationTargetException e) {
// Display the error during copy.
- Throwable throwable = e.getTargetException() != null ? e.getTargetException() : e;
+ Throwable throwable = e.getTargetException();
+ if(throwable instanceof TCFException) {
+ int severity = ((TCFException)throwable).getSeverity();
+ status = new Status(severity, UIPlugin.getUniqueIdentifier(), throwable.getMessage(), throwable);
+ }
+ else {
+ status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), throwable.getMessage(), throwable);
+ }
MessageDialog.openError(parent, operation.getName(), throwable.getMessage());
- status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), throwable.getMessage(), throwable);
}
catch (InterruptedException e) {
// It is canceled.

Back to the top