Asynchronous dir.close() throws immediately, if already closed #36237
Labels
confirmed-bug
Issues with confirmed bugs.
fs
Issues and PRs related to the fs subsystem / file system.
What steps will reproduce the bug?
Calling asynchronous version of dir.close() with dir already closed, e.g. by it's async iterator.
How often does it reproduce? Is there a required condition?
Always, when dir.close() is called redundantly.
What is the expected behavior?
Asynchronous functions should forward errors via callback, unless the provided callback argument itself is invalid.
What do you see instead?
Error is thrown immediately (synchronously), This is especially embarrassing with promises API:
Additional information
If this behaviour is intentional, it should be documented; otherwise I would gladly provide a fix.
The text was updated successfully, but these errors were encountered: