Repository navigation
Conversation
756b1cb turned the error code that ext-uv 0.3 passes to the uv_fs_open() callback into null, so that read() and write() throw FilesystemException instead of passing it on as a file handle (a TypeError), but without the error: "Failed opening write file handle" on a full disk, a missing directory or a permission error alike. doFsOpen() now throws itself, with the path and the error of libuv (uv_strerror()), and tests check that a failed read or write throws FilesystemException with every driver.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
756b1cb ("Fix uv_fs_open return value handling") maps the error code that ext-uv 0.3 passes to the
uv_fs_open()callback tonull, so thatread()andwrite()throwFilesystemExceptioninstead of aTypeError. But the message loses the error: "Failed opening write file handle" whether the disk is full, the directory is missing or permission is denied.doFsOpen()now throws itself, with the path and libuv's error (uv_strerror()):Failed opening file handle to /nonexistent-dir/x: no such file or directory. That also removes the two duplicated checks in the callers.Tests
FilesystemDriverTestcover every driver: a failed read or write throwsFilesystemException. They guard against the regression that 756b1cb fixed; before it, ext-uv 0.3 gave aTypeError.ParallelFileTest::testSimultaneousLock/testTryLockLoopandUvFileTest::testClose/testWriteAfterClosefail on 4.x either way.The 3.x backport of 756b1cb, with this change, is #103.
https://claude.ai/code/session_0185K6MyhFXHvLLtf79c6Xif