From 528bf3718dae2e3f8edf05c35b76ece507d83138 Mon Sep 17 00:00:00 2001 From: rajasec Date: Thu, 29 Sep 2016 09:56:07 +0530 Subject: [PATCH] ps error logging improvement Signed-off-by: rajasec ps error logging improvement Signed-off-by: rajasec --- ps.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ps.go b/ps.go index 6101bfad..692fc4a9 100644 --- a/ps.go +++ b/ps.go @@ -51,9 +51,10 @@ var psCommand = cli.Command{ psArgs = []string{"-ef"} } - output, err := exec.Command("ps", psArgs...).Output() + cmd := exec.Command("ps", psArgs...) + output, err := cmd.CombinedOutput() if err != nil { - return err + return fmt.Errorf("%s: %s", err, output) } lines := strings.Split(string(output), "\n")