error.go 368 B

123456789101112131415161718
  1. package zfs
  2. import (
  3. "fmt"
  4. )
  5. // Error is an error which is returned when the `zfs` or `zpool` shell
  6. // commands return with a non-zero exit code.
  7. type Error struct {
  8. Err error
  9. Debug string
  10. Stderr string
  11. }
  12. // Error returns the string representation of an Error.
  13. func (e Error) Error() string {
  14. return fmt.Sprintf("%s: %q => %s", e.Err, e.Debug, e.Stderr)
  15. }