Hi,
(ordinary mortals: you can stop reading here, it gets down into the underworld of PI
![Evil >:D](http://pixinsight.com/forum/Smileys/default/evil.gif)
)
the following happens when using the SystemCommand module described in
http://pixinsight.com/forum/index.php?topic=1791.0, but probably happens with any (standard) PI module that returns false on executeGlobal() when used from PJSR:
The following PJSR script should execute "ls", "echo run 1", fail on "bla bla" and continue with "echo run 2":
var testFunc=function(sCommandLine){
var pSystemCommand=new SystemCommand;
with (pSystemCommand) {
commandLine=sCommandLine;
}
console.writeln("starting ",sCommandLine);
try {
pSystemCommand.executeGlobal();
}catch(e){
console.writeln("caught ",sCommandLine);
}
console.writeln("done ",sCommandLine);
}
testFunc("ls");
testFunc("echo run 1");
// following fails because bla does not exist as executable
testFunc("bla bla");
// never gets here.
testFunc("echo run 2");
In reality, it never gets beyond "bla bla", because in this case on the C++ level, SystemCommandInstance::executeGlobal() returns false. The output is this:
run -execute-mode=auto "/home/georg/tmp/scripts/test.js"
Processing script file: /home/georg/tmp/scripts/test.js
starting ls
SystemCommand: Global context
Running command (see terminal for ouput): ls
Running with maxTime=100
Makefile
Makefile~
makefile-x86_64
makefile-x86_64~
x86_64
Did run (see terminal for ouput): ls
0.161 s
done ls
starting echo run 1
SystemCommand: Global context
Running command (see terminal for ouput): echo run 1
Running with maxTime=100
run 1
Did run (see terminal for ouput): echo run 1
0.186 s
done echo run 1
starting bla bla
SystemCommand: Global context
Running command (see terminal for ouput): bla bla
Running with maxTime=100
Did run (see terminal for ouput): bla bla
<* failed *>
Cheers,
Georg