diff --git a/internal/cephfs/errors.go b/internal/cephfs/errors.go index 4ae376e53..7cacf72a8 100644 --- a/internal/cephfs/errors.go +++ b/internal/cephfs/errors.go @@ -27,6 +27,11 @@ func (e ErrInvalidVolID) Error() string { return e.err.Error() } +// Unwrap returns the encapsulated error of ErrInvalidVolID. +func (e ErrInvalidVolID) Unwrap() error { + return e.err +} + // ErrNonStaticVolume is returned when a volume is detected as not being // statically provisioned type ErrNonStaticVolume struct { @@ -38,6 +43,11 @@ func (e ErrNonStaticVolume) Error() string { return e.err.Error() } +// Unwrap returns the encapsulated error of ErrNonStaticVolume. +func (e ErrNonStaticVolume) Unwrap() error { + return e.err +} + // ErrVolumeNotFound is returned when a subvolume is not found in CephFS type ErrVolumeNotFound struct { err error @@ -47,3 +57,8 @@ type ErrVolumeNotFound struct { func (e ErrVolumeNotFound) Error() string { return e.err.Error() } + +// Unwrap returns the encapsulated error of ErrVolumeNotFound. +func (e ErrVolumeNotFound) Unwrap() error { + return e.err +}