Skip to content

Commit

Permalink
🧹 more windows error handling (#4752)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Oct 15, 2024
1 parent 3ee408e commit 415b9f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions providers/os/resources/processes/ps1getprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ func (wpm *WindowsProcessManager) List() ([]*OSProcess, error) {
return nil, fmt.Errorf("processes> could not run command")
}

if c.ExitStatus != 0 {
stderr, err := io.ReadAll(c.Stderr)
if err != nil {
return nil, err
}
return nil, errors.New("failed to retrieve process list: " + string(stderr))
}

entries, err := ParseWindowsProcesses(c.Stdout)
if err != nil {
return nil, err
Expand Down

0 comments on commit 415b9f3

Please sign in to comment.