Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-07-30 11:52:38 +0000
committerTobias Schwarz2012-07-30 11:54:30 +0000
commitaaa0b76751e2279d6b2c7fa8d73d0bcb324ef629 (patch)
treeb4984de6fc52da31473248f8d46a9bf708072b4c /target_explorer/plugins/org.eclipse.tcf.te.core
parent91586e1341e4c7bf1340cee74a6d68abe5979785 (diff)
downloadorg.eclipse.tcf-aaa0b76751e2279d6b2c7fa8d73d0bcb324ef629.tar.gz
org.eclipse.tcf-aaa0b76751e2279d6b2c7fa8d73d0bcb324ef629.tar.xz
org.eclipse.tcf-aaa0b76751e2279d6b2c7fa8d73d0bcb324ef629.zip
Target Explorer: rework error handling
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
index 3639b835a..912ad2a1b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
@@ -14,10 +14,9 @@ import java.util.concurrent.ExecutionException;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.te.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
/**
* The asynchronous callback collector is an extension to the asynchronous callback handler. The
@@ -118,7 +117,9 @@ public class AsyncCallbackCollector extends AsyncCallbackHandler {
public AsyncCallbackCollector(ICallback callback, ICallbackInvocationDelegate delegate) {
super();
- if (callback != null) Assert.isNotNull(delegate);
+ if (callback != null) {
+ Assert.isNotNull(delegate);
+ }
// We have to add our master callback to the list of callback to avoid that
// the collector is running empty to early!
@@ -165,11 +166,7 @@ public class AsyncCallbackCollector extends AsyncCallbackHandler {
delegate.invoke(new Runnable() {
@Override
public void run() {
- Throwable error = getError();
- IStatus status = new Status((error != null ? (error instanceof OperationCanceledException ? IStatus.CANCEL : IStatus.ERROR) : IStatus.OK),
- CoreBundleActivator.getUniqueIdentifier() != null ? CoreBundleActivator.getUniqueIdentifier() : "", //$NON-NLS-1$
- 0, (error != null ? error.getMessage() : null), error);
- callback.done(this, status);
+ callback.done(this, StatusHelper.getStatus(getError()));
}
});
}

Back to the top