diff --git a/packages/bindings/lib/unix-read.js b/packages/bindings/lib/unix-read.js index fe6bda557..ea3107d11 100644 --- a/packages/bindings/lib/unix-read.js +++ b/packages/bindings/lib/unix-read.js @@ -46,7 +46,7 @@ const unixRead = async ({ binding, buffer, offset, length, fsReadAsync = readAsy err.errno === -1 // generic error if (disconnectError) { - err.canceled = true + err.disconnect = true logger('disconnecting', err) } diff --git a/packages/bindings/lib/unix-read.test.js b/packages/bindings/lib/unix-read.test.js index ac9c58ef7..6b289dba6 100644 --- a/packages/bindings/lib/unix-read.test.js +++ b/packages/bindings/lib/unix-read.test.js @@ -95,10 +95,10 @@ describe('unixRead', () => { const err = await shouldReject(unixRead({ binding: mock, buffer: readBuffer, offset: 0, length: 8, fsReadAsync })) assert.isTrue(err.canceled) }) - it('rejects a canceled error when fsread errors a disconnect error', async () => { + it('rejects a disconnected error when fsread errors a disconnect error', async () => { const readBuffer = Buffer.alloc(8, 0) const fsReadAsync = makeFsReadError('EBADF') const err = await shouldReject(unixRead({ binding: mock, buffer: readBuffer, offset: 0, length: 8, fsReadAsync })) - assert.isTrue(err.canceled) + assert.isTrue(err.disconnect) }) })