| Summary: | G4UImanager::ApplyCommand returns 0 when executing non-existing macro file | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Nicola Mori <mori> |
| Component: | intercoms | Assignee: | asai |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | mori |
| Priority: | P4 | ||
| Version: | 10.4 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Thank you for reporting this issue. We will fix it with the next patch release. Kind regards, Makoto Asai The fix will be included in the next patch release (version 10.5-patch02). There is no immediate plan of porting it back to the previous versions as this fix requires a functionality introduced with 10.5. Thank you for reporting this issue, once again. Makoto Thank you Makoto for the quick fix. Is there an estimate about when the 10.5-patch02 version will be released? |
In my application I execute the command given in a macro file by means of: G4UImanager* UImanager = G4UImanager::GetUIpointer(); auto result UImanager->ApplyCommand(std::string("/control/execute ") + fileName); std::cout << "result: " << result << std::endl; According to the comment in G4UImanager.hh, the return value should be positive non-zero when an error occurs. However, it is 0 when fileName is the name of a non-existing file: ERROR: Can not open a macro file <nonExistingFile.mac>. Set macro path with "/control/macroPath" if needed. result: 0 Similarly, when the macro contains a bad command the return value is again 0: ***** COMMAND NOT FOUND </nonExistingCommand> ***** ***** Batch is interrupted!! ***** result: 0 So how can I check whether the execution of the macro has been successful or not?