Skip to content

Commit

Permalink
Merge pull request #37 from juergenhoetzel/pacman-error-reporting
Browse files Browse the repository at this point in the history
Pacman search: Return error if exec failed
  • Loading branch information
ericm authored Oct 25, 2021
2 parents 4368489 + 8ee9c26 commit 793bf3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ func Pacman(query string, print bool, installed bool) ([]output.Package, error)
search := exec.Command("pacman", append([]string{"-Ss"}, strings.Split(query, " ")...)...)
run, err := search.Output()
if err != nil {
return []output.Package{}, nil
execErr := err.(*exec.ExitError)
return []output.Package{}, fmt.Errorf("%w: %s", execErr, execErr.Stderr)
}

// Find Package vals
Expand Down

0 comments on commit 793bf3a

Please sign in to comment.