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
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')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java43
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.properties1
3 files changed, 27 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);
+ }
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.java
index e7a147706..b3e63f5cb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.java
@@ -36,4 +36,5 @@ public class Messages extends NLS {
public static String ScriptLauncher_error_illegalIndex;
public static String ScriptLauncher_error_parsingScript;
public static String ScriptLauncher_error_executionFailed;
+ public static String ScriptLauncher_error_serviceNotAvailable;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.properties
index 331c80c58..a467585bf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/nls/Messages.properties
@@ -10,3 +10,4 @@ ScriptLauncher_error_illegalNullArgument=Illegal argument: ''{0}'' has to be not
ScriptLauncher_error_illegalIndex=Illegal index ''{0}''.
ScriptLauncher_error_parsingScript=Parsing of the script failed.\n\nPossible Cause:\n{0}
ScriptLauncher_error_executionFailed=Script execution failed.\n\nPossible Cause:\n{0}
+ScriptLauncher_error_serviceNotAvailable=Script execution failed.\n\nPossible Cause:\nService ''{0}'' is not available on peer ''{1}''.

Back to the top