mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-23 21:40:20 +00:00
util: add New* funcs for ErrKeyNotFound & ErrPoolNotFound types
These types have private fields but we need to construct them outside of the util package. Add New* methods for both. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
1a1ad11f57
commit
f3192bd1b3
@ -22,6 +22,10 @@ type ErrKeyNotFound struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func NewErrKeyNotFound(keyName string, err error) ErrKeyNotFound {
|
||||
return ErrKeyNotFound{keyName, err}
|
||||
}
|
||||
|
||||
func (e ErrKeyNotFound) Error() string {
|
||||
return e.err.Error()
|
||||
}
|
||||
@ -71,3 +75,7 @@ type ErrPoolNotFound struct {
|
||||
func (e ErrPoolNotFound) Error() string {
|
||||
return e.Err.Error()
|
||||
}
|
||||
|
||||
func NewErrPoolNotFound(pool string, err error) ErrPoolNotFound {
|
||||
return ErrPoolNotFound{pool, err}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user