-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcefully set ioe_filename in IOException? #17
Comments
Essentially I'm asking to do what openFile :: FilePath -> IOMode -> IO Handle
openFile fp im =
catchException
(openFile' fp im dEFAULT_OPEN_IN_BINARY_MODE True)
(\e -> ioError (addFilePathToIOError "openFile" fp e)) It catches the underlying IO exception and rethrows it, forcefully setting |
Yes, we should try to mimick base as much as possible. |
hasufell
added a commit
that referenced
this issue
Jan 13, 2024
Fixes #17 Also improves the property tests to examine more of the IOException.
hasufell
added a commit
that referenced
this issue
Jan 13, 2024
Fixes #17 Also improves the property tests to examine more of the IOException.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed in https://github.com/hasufell/file-io/actions/runs/7500925884/job/20420565223#step:5:295 that the exceptions seemingly do not set
ioe_filename
field ofIOException
. That's explainable:mkFD
(which is responsible for this particular error) does not have a filename at hand.A simple (crossplatform!) reproducer is this:
It would be painful to debug such write lock in a real-life application, because the error message does not mention which filename is locked.
Could functions in
file-io
catch and re-throwIOException
s, forcefully settingioe_filename
if empty?The text was updated successfully, but these errors were encountered: