diff --git a/rbd/diff_iterate_test.go b/rbd/diff_iterate_test.go index 6a4019f..3b4ff46 100644 --- a/rbd/diff_iterate_test.go +++ b/rbd/diff_iterate_test.go @@ -335,8 +335,8 @@ func testDiffIterateEarlyExit(t *testing.T, ioctx *rados.IOContext) { }, }) assert.Error(t, err) - if errno, ok := err.(interface{ Errno() int }); assert.True(t, ok) { - assert.EqualValues(t, -5, errno.Errno()) + if errno, ok := err.(interface{ ErrorCode() int }); assert.True(t, ok) { + assert.EqualValues(t, -5, errno.ErrorCode()) } if assert.Len(t, calls, 1) { assert.EqualValues(t, 0, calls[0].offset) diff --git a/rbd/errors.go b/rbd/errors.go index 87a43b2..73336b7 100644 --- a/rbd/errors.go +++ b/rbd/errors.go @@ -23,7 +23,7 @@ func (e rbdError) Error() string { return fmt.Sprintf("rbd: ret=%d, %s", errno, s) } -func (e rbdError) Errno() int { +func (e rbdError) ErrorCode() int { return int(e) } diff --git a/rbd/errors_test.go b/rbd/errors_test.go index 1fc1065..d37ee43 100644 --- a/rbd/errors_test.go +++ b/rbd/errors_test.go @@ -15,10 +15,10 @@ func TestRBDError(t *testing.T) { assert.Error(t, err) assert.Equal(t, err.Error(), "rbd: ret=39, Directory not empty") - 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(), -39) + assert.Equal(t, errno.ErrorCode(), -39) err = getError(345) // no such errno assert.Error(t, err)