intersystems / intersystems/ipm

Improve handling of error conditions running OS-level commands

Open
#435 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.