Skip to content
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

Creating a non-existent directory in the root directory silently fails #4

Closed
mineo opened this issue Sep 9, 2014 · 3 comments
Closed
Labels
type: a-bug The described behavior is not working as intended.
Milestone

Comments

@mineo
Copy link

mineo commented Sep 9, 2014

» git rev-parse HEAD
2cb6678
» cabal repl
Preprocessing library directory-1.2.1.1...
[1 of 1] Compiling System.Directory ( System/Directory.hs, dist/build/System/Directory.o )
[...]
*System.Directory> createDirectoryIfMissing True "/foo"
*System.Directory> createDirectoryIfMissing True "/foo/bar"
*** Exception: /foo/bar: createDirectory: does not exist (No such file or directory)

AFAICT

) `E.catch` ((\_ -> return ()) :: IOException -> IO ())
is swallowing the exception thrown by
else throw e
.

@jpvillaisaza
Copy link

Line 408 is the one ignoring the error, but the error is in line 403, not 406. I think. Posix.getFileStatus throws an exception and line 408 does a return () after that.

@jpvillaisaza
Copy link

We could modify line 408:

) `E.catch` ((\_ -> return ()) :: IOException -> IO ())

Do we really need to do a E.catch and then a return ()? Why not throw instead of return () or no E.catch at all?

@jpvillaisaza
Copy link

Also, isAlreadyExistsError and isPermissionError (Line 396) are handled together. They should be separate so than we can get an exception if there is a permissions error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: a-bug The described behavior is not working as intended.
Projects
None yet
Development

No branches or pull requests

3 participants