mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cephfs: add Unwrap() to error types
See-also: https://github.com/golang/go/wiki/ErrorValueFAQ#i-have-a-type-that-implements-error-and-holds-a-nested-error-how-should-i-adapt-it-to-the-new-features Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
0bafa2be8c
commit
fad0cf7f1c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user