Log error output for execCommandJson as well.

This commit is contained in:
Chia-liang Kao 2018-08-08 23:39:19 +08:00
parent 6f484f92fc
commit a1de128a81

View File

@ -48,7 +48,7 @@ func execCommandJson(v interface{}, program string, args ...string) error {
out, err := cmd.CombinedOutput()
if err != nil {
return err
return fmt.Errorf("cephfs: %s failed with following error: %s\ncephfs: %s output: %s", program, err, program, out)
}
return json.NewDecoder(bytes.NewReader(out)).Decode(v)