intersystems / intersystems/ipm
Improve handling of error conditions running OS-level commands
- Dominant language
- ObjectScript
- Stars
- 41
- Forks
- 29
- Avg merge
- 23h 54m
- Merged PRs (30d)
- 4
Description
I run into an issue when installing a package (git-source-control in my case, but is not relevant) but the ZPM installer reported no error, nevertheless something went wrong, some files were missing in the target system.
The issue with ZPM is that if the method RunCommand() in class %ZPM.PackageManager.Developer.Utils is unable to run an operating system command then the error returned is not properly handled and no error is reported.
The problematic error handling is in line 107 in the class %ZPM.PackageManager.Developer.File:
if $$$ISERR(tSC),$Get(retCode)<8 set tSC=$$$OK
When $zf(-100) fail with error, then RunCommand() returns the error in tSC and retCode="".
Unfortunately in this case the error is reset to $$$OK.
The same problematic error handling is also in line 45 of the same class.
As a side note, the underlying issue with the failure of $zf(-100) is caused by [this issue.](https://community.intersystems.com/post/operating-system-command-execution-and-windows-console)
I think that the error check/handing should be fixed to actually report that an error has occurred during the installation.
Contributor guide
Assessment
This issue has not been assessed yet.