Problem 734

Summary: G4UIbatch should not simply continue if invalid command is encountered
Product: Geant4 Reporter: DRay
Component: interfacesAssignee: asai
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P5    
Version: 7.0   
Hardware: All   
OS: All   

Description DRay 2005-03-29 16:14:13 CEST
If one is running a macro file in batch mode, then a command which is invalid
for some reason should cause the simulation to terminate, rather than the
command simply being ignored. Presumably, the command was typed in wrongly by
the person composing the macro, and not running the proper command will lead to
undetermined Monte Carlo results.

81         G4int rc = UImanager->ApplyCommand(commandLine);

In my opinion, Geant should throw an exception if rc is nonzero.
Comment 1 asai 2005-05-19 11:08:59 CEST
Thank you for reporting about this concern.
It makes lots of sense to terminate the batch execution if a coomand in the
macro file is invalid. On the other hand, issuing an exception and terminating
the entire program might not be a desired behavior if the macro file is issued
from an interactive session. I modified G4UIbatch so that it now aborts the
execution of the problematic macro file (and any other parent macro files which
issued this macro file) if a command is invalid. Thus, if the program is purely
in the batch mode, the program terminates, while program comes back to the
interactive mode if this problematic macro file is issued by an interactive
command. This modification should be included in the coming release.