Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-12-23 06:56:32 +0000
committerUwe Stieber2011-12-23 07:18:04 +0000
commite63c875e8cb5c71f478ce5d5f0fbd3f55161f580 (patch)
tree016e916b16438eb46f86b18b7fde881a1959a80f /target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher
parent5bba6271a59f76cb2f153121a881a006a20e0fec (diff)
downloadorg.eclipse.tcf-e63c875e8cb5c71f478ce5d5f0fbd3f55161f580.tar.gz
org.eclipse.tcf-e63c875e8cb5c71f478ce5d5f0fbd3f55161f580.tar.xz
org.eclipse.tcf-e63c875e8cb5c71f478ce5d5f0fbd3f55161f580.zip
Target Explorer: Script execution errors are presented to the user
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java43
1 files changed, 25 insertions, 18 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
index ec65b0510..e4a90ec62 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
@@ -317,28 +317,35 @@ public class ScriptLauncher extends PlatformObject implements IScriptLauncher {
Token token = tokens[index];
IService service = channel.getRemoteService(token.getServiceName());
- new Command(channel, service, token.getCommandName(), token.getArguments()) {
+ if (service != null) {
+ new Command(channel, service, token.getCommandName(), token.getArguments()) {
- @Override
- public void done(Exception error, Object[] args) {
- if (error == null) {
- // Execute the next token
- int nextIndex = index + 1;
- if (nextIndex == tokens.length) {
- // All tokens executed
- invokeCallback(Status.OK_STATUS, null);
+ @Override
+ public void done(Exception error, Object[] args) {
+ if (error == null) {
+ // Execute the next token
+ int nextIndex = index + 1;
+ if (nextIndex == tokens.length) {
+ // All tokens executed
+ invokeCallback(Status.OK_STATUS, null);
+ } else {
+ executeToken(tokens, nextIndex);
+ }
} else {
- executeToken(tokens, nextIndex);
+ // Stop the execution
+ IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.ScriptLauncher_error_parsingScript, error.getLocalizedMessage()),
+ error);
+ invokeCallback(status, null);
}
- } else {
- // Stop the execution
- IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
- NLS.bind(Messages.ScriptLauncher_error_parsingScript, error.getLocalizedMessage()),
- error);
- invokeCallback(status, null);
}
- }
- };
+ };
+ } else {
+ IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.ScriptLauncher_error_serviceNotAvailable, token.getServiceName(), channel.getRemotePeer().getID()),
+ null);
+ invokeCallback(status, null);
+ }
}
/**

Back to the top