mirror of
https://github.com/ceph/go-ceph
synced 2025-02-16 10:37:19 +00:00
cephfs: made ENOENT a public error
this commit renames ErrNoEntry of cephfs to ErrNotExist and making it public allowing other projects to access this. Signed-off-by: Riya Singhal <rsinghal@redhat.com>
This commit is contained in:
parent
51b8287148
commit
2852a13c88
@ -54,6 +54,8 @@ const (
|
|||||||
// ErrNotConnected may be returned when client is not connected
|
// ErrNotConnected may be returned when client is not connected
|
||||||
// to a cluster.
|
// to a cluster.
|
||||||
ErrNotConnected = cephFSError(-C.ENOTCONN)
|
ErrNotConnected = cephFSError(-C.ENOTCONN)
|
||||||
|
// ErrNotExist indicates a non-specific missing resource.
|
||||||
|
ErrNotExist = cephFSError(-C.ENOENT)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Private errors:
|
// Private errors:
|
||||||
@ -61,6 +63,5 @@ const (
|
|||||||
const (
|
const (
|
||||||
errInvalid = cephFSError(-C.EINVAL)
|
errInvalid = cephFSError(-C.EINVAL)
|
||||||
errNameTooLong = cephFSError(-C.ENAMETOOLONG)
|
errNameTooLong = cephFSError(-C.ENAMETOOLONG)
|
||||||
errNoEntry = cephFSError(-C.ENOENT)
|
|
||||||
errRange = cephFSError(-C.ERANGE)
|
errRange = cephFSError(-C.ERANGE)
|
||||||
)
|
)
|
||||||
|
@ -53,7 +53,7 @@ func TestRemoveDir(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
_, err = mount.Statx(dirname, StatxBasicStats, 0)
|
_, err = mount.Statx(dirname, StatxBasicStats, 0)
|
||||||
assert.Equal(t, err, errNoEntry)
|
assert.Equal(t, err, ErrNotExist)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLink(t *testing.T) {
|
func TestLink(t *testing.T) {
|
||||||
@ -367,7 +367,7 @@ func TestStatx(t *testing.T) {
|
|||||||
st, err = mount.Statx(dirname, StatxBasicStats, 0)
|
st, err = mount.Statx(dirname, StatxBasicStats, 0)
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
assert.Nil(t, st)
|
assert.Nil(t, st)
|
||||||
assert.Equal(t, errNoEntry, err)
|
assert.Equal(t, ErrNotExist, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("invalidMount", func(t *testing.T) {
|
t.Run("invalidMount", func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user