fs: correct error message when FileHandle is transferred

PR-URL: https://github.com/nodejs/node/pull/59156
Fixes: https://github.com/nodejs/node/issues/59155
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
Alex Yang authored and RafaelGSS committed 2025-08-12 09:19:57 -03:00
1 parent 8c609be1b1
commit e2fb4caf9c
2 files changed
+8 -1

No files matched your search

@@ -69,6 +69,11 @@ const { once } = require('events');
assert.strictEqual(fh.fd, -1);
port1.postMessage('second message');
await assert.rejects(() => fh.read(), {
code: 'EBADF',
message: 'The FileHandle has been transferred',
syscall: 'read'
});
})().then(common.mustCall());
(async function() {