Skip to content

Commit 0d795e7

Browse files
doc: clarify FileHandle error handling
Refs: #51135
1 parent a0423e2 commit 0d795e7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

doc/api/fs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ added: v10.0.0
242242
Closes the file handle after waiting for any pending operation on the handle to
243243
complete.
244244

245+
The promise is rejected if closing the file handle fails. In case of an error,
246+
the error's `code` will be one of [Common System Errors][].
247+
245248
```mjs
246249
import { open } from 'node:fs/promises';
247250

@@ -795,6 +798,9 @@ changes:
795798
* `signal` {AbortSignal} An AbortSignal to cancel the operation. **Default:** `undefined`.
796799
* Returns: {Promise} Fulfills with an {fs.Stats} for the file.
797800
801+
The promise is rejected if the stat operation fails. In case of an error, the
802+
error's `code` will be one of [Common System Errors][].
803+
798804
#### `filehandle.sync()`
799805
800806
<!-- YAML

0 commit comments

Comments
 (0)