zfs: include stderr of command in ZFSError.Error()

Since we don't implement screen-scraping of ZFS output ATM, this is
better than nothing, as user's may be able to figure out what' sthe
problem from the logs / status reports.
This commit is contained in:
Christian Schwarz 2018-09-02 15:32:08 -07:00
parent ad28fd1ecb
commit f0860767f5

View File

@ -136,7 +136,7 @@ type ZFSError struct {
} }
func (e ZFSError) Error() string { func (e ZFSError) Error() string {
return fmt.Sprintf("zfs exited with error: %s", e.WaitErr.Error()) return fmt.Sprintf("zfs exited with error: %s\nstderr:\n%s", e.WaitErr.Error(), e.Stderr)
} }
var ZFS_BINARY string = "zfs" var ZFS_BINARY string = "zfs"