Merge pull request #65 from clkao/execCommandJson-error

Log error output for execCommandJson as well.
This commit is contained in:
Róbert Vašek 2018-08-08 17:58:52 +02:00 committed by GitHub
commit 069140e74a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,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)