mirror of https://github.com/ceph/go-ceph
rados: modify validate() to return ErrInvalidIOContext error
If ioctx is not ready to be used then validate() should return ErrInvalidIOContext error. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
parent
8788a901dc
commit
558b366fbb
|
@ -54,6 +54,9 @@ var (
|
||||||
// ErrEmptyArgument may be returned if a function argument is passed
|
// ErrEmptyArgument may be returned if a function argument is passed
|
||||||
// a zero-length slice or map.
|
// a zero-length slice or map.
|
||||||
ErrEmptyArgument = errors.New("Argument must contain at least one item")
|
ErrEmptyArgument = errors.New("Argument must contain at least one item")
|
||||||
|
// ErrInvalidIOContext may be returned if an api call requires an IOContext
|
||||||
|
// but IOContext is not ready for use.
|
||||||
|
ErrInvalidIOContext = errors.New("IOContext is not ready for use")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Public radosErrors:
|
// Public radosErrors:
|
||||||
|
|
|
@ -96,7 +96,7 @@ type IOContext struct {
|
||||||
// with ceph C calls.
|
// with ceph C calls.
|
||||||
func (ioctx *IOContext) validate() error {
|
func (ioctx *IOContext) validate() error {
|
||||||
if ioctx.ioctx == nil {
|
if ioctx.ioctx == nil {
|
||||||
return ErrNotConnected
|
return ErrInvalidIOContext
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue