From 67eb5957d135f5ba4b73ecfb8d5695d979f3fef7 Mon Sep 17 00:00:00 2001 From: Bob Put Date: Tue, 2 Jun 2026 18:47:27 -0400 Subject: [PATCH] doc: clarify FileHandle error handling Fixes: https://github.com/nodejs/node/issues/51135 Signed-off-by: Bob Put --- doc/api/fs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 350555f2f8ad99..bd767a409a53a2 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -242,6 +242,9 @@ added: v10.0.0 Closes the file handle after waiting for any pending operation on the handle to complete. +The promise is rejected if closing the file handle fails. In case of an error, +the error's `code` will be one of [Common System Errors][]. + ```mjs import { open } from 'node:fs/promises'; @@ -795,6 +798,9 @@ changes: * `signal` {AbortSignal} An AbortSignal to cancel the operation. **Default:** `undefined`. * Returns: {Promise} Fulfills with an {fs.Stats} for the file. +The promise is rejected if the stat operation fails. In case of an error, the +error's `code` will be one of [Common System Errors][]. + #### `filehandle.sync()`