diff options
author | Uwe Stieber | 2013-09-26 12:11:24 +0000 |
---|---|---|
committer | Uwe Stieber | 2013-09-26 12:15:02 +0000 |
commit | 69c0e3941c8c363eb6f7ddf676cd47db3012ac63 (patch) | |
tree | 40edb0bbd19ac06fb2e16d91eced21c271e68c68 /target_explorer/plugins | |
parent | 0e17f9a9141f6c85e1c6e80e51576ec9bb27e552 (diff) | |
download | org.eclipse.tcf-69c0e3941c8c363eb6f7ddf676cd47db3012ac63.tar.gz org.eclipse.tcf-69c0e3941c8c363eb6f7ddf676cd47db3012ac63.tar.xz org.eclipse.tcf-69c0e3941c8c363eb6f7ddf676cd47db3012ac63.zip |
Target Explorer: Improve error message in case the connection attempt is failing.
Diffstat (limited to 'target_explorer/plugins')
3 files changed, 32 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java index 92c2e1c4a..80b8fc5ec 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java @@ -69,4 +69,6 @@ public class Messages extends NLS { public static String WaitForReadyStep_error_timeout; public static String WaitForReadyStep_error_state; + public static String WaitForReadyStep_error_reason_unknown; + public static String WaitForReadyStep_error_reason_cause; } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties index cc3b12cc6..3a7425145 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties @@ -8,5 +8,12 @@ # Wind River Systems - initial API and implementation ############################################################################### -WaitForReadyStep_error_timeout=Timeout waiting for peer to become ready -WaitForReadyStep_error_state=Illegal peer state
\ No newline at end of file +WaitForReadyStep_error_timeout=Failed to connect to ''{0}''.\n\n\ +The connection attempt timed out. Please check that the connection properties are\n\ +valid. Verify also that no firewall is blocking the communication. +WaitForReadyStep_error_state=Failed to connect to ''{0}''.\n\n\{1}. +WaitForReadyStep_error_reason_unknown=\ +The connection attempt has been terminated for unknown reasons. Please check that\n\ +the connection properties are valid. +WaitForReadyStep_error_reason_cause=\ +The connection attempt has been terminated.\n\nPossible cause:\n{0} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java index 0d5be9306..c11904a8f 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java @@ -16,6 +16,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.runtime.callback.Callback; @@ -68,7 +69,9 @@ public class WaitForReadyStep extends AbstractPeerModelStep { return; } else if (refreshCount >= getTotalWork(context, data)) { - callback(data, fullQualifiedId, callback, StatusHelper.getStatus(new TimeoutException(Messages.WaitForReadyStep_error_timeout)), null); + @SuppressWarnings("synthetic-access") + String message = NLS.bind(Messages.WaitForReadyStep_error_timeout, getActivePeerContext(context, data, fullQualifiedId).getName()); + callback(data, fullQualifiedId, callback, StatusHelper.getStatus(new TimeoutException(message)), null); } else if (getActivePeerModelContext(context, data, fullQualifiedId).isProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_WAITING_FOR_READY)) { // Refresh the model now (must be executed within the TCF dispatch thread) @@ -95,8 +98,23 @@ public class WaitForReadyStep extends AbstractPeerModelStep { } callback(data, fullQualifiedId, callback, Status.OK_STATUS, null); } - else - callback(data, fullQualifiedId, callback, StatusHelper.getStatus(new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), Messages.WaitForReadyStep_error_state))), null); + else { + @SuppressWarnings("synthetic-access") + String message = NLS.bind(Messages.WaitForReadyStep_error_state, getActivePeerContext(context, data, fullQualifiedId).getName()); + + String cause = null; + if (state == IPeerModelProperties.STATE_ERROR) { + cause = getActivePeerModelContext(context, data, fullQualifiedId).getStringProperty(IPeerModelProperties.PROP_LAST_SCANNER_ERROR); + } + + if (cause != null && !"".equals(cause.trim())) { //$NON-NLS-1$ + message += NLS.bind(Messages.WaitForReadyStep_error_reason_cause, cause); + } else { + message += Messages.WaitForReadyStep_error_reason_unknown; + } + + callback(data, fullQualifiedId, callback, StatusHelper.getStatus(new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), message))), null); + } } } }); |