Improved error message for remote version package output

This commit is contained in:
2025-07-09 23:20:11 -05:00
parent b91cf18b04
commit 47b2aabd9f
8 changed files with 45 additions and 25 deletions

View File

@@ -333,11 +333,12 @@ func getCommandTypeAndSetCommandInfo(command *Command) *Command {
func parsePackageVersion(output string, cmdCtxLogger zerolog.Logger, command *Command, cmdOutBuf bytes.Buffer) ([]string, error) {
var err error
var errs []error
pkgVersionOnSystem, errs := command.pkgMan.ParseRemotePackageManagerVersionOutput(output)
if errs != nil {
cmdCtxLogger.Error().Errs("Error parsing package version output", errs).Send()
return collectOutput(&cmdOutBuf, command.Name, cmdCtxLogger, command.Output.ToLog), fmt.Errorf("error parsing package version output: %v", errs)
pkgVersionOnSystem, err := command.pkgMan.ParseRemotePackageManagerVersionOutput(output)
if err != nil {
cmdCtxLogger.Error().AnErr("Error parsing package version output", err).Send()
return collectOutput(&cmdOutBuf, command.Name, cmdCtxLogger, command.Output.ToLog), fmt.Errorf("error parsing package version output: %v", err)
}
for _, p := range pkgVersionOnSystem {