diff --git a/cephfs/errors.go b/cephfs/errors.go index 1462fc4..6cb0de1 100644 --- a/cephfs/errors.go +++ b/cephfs/errors.go @@ -24,7 +24,7 @@ func (e cephFSError) Error() string { return fmt.Sprintf("cephfs: ret=%d, %s", errno, s) } -func (e cephFSError) Errno() int { +func (e cephFSError) ErrorCode() int { return int(e) } diff --git a/cephfs/errors_test.go b/cephfs/errors_test.go index aa8ef72..7bdfd33 100644 --- a/cephfs/errors_test.go +++ b/cephfs/errors_test.go @@ -15,10 +15,10 @@ func TestCephFSError(t *testing.T) { assert.Error(t, err) assert.Equal(t, err.Error(), "cephfs: ret=5, Input/output error") - errno, ok := err.(interface{ Errno() int }) + errno, ok := err.(interface{ ErrorCode() int }) assert.True(t, ok) require.NotNil(t, errno) - assert.Equal(t, errno.Errno(), -5) + assert.Equal(t, errno.ErrorCode(), -5) err = getError(345) // no such errno assert.Error(t, err)