-
Notifications
You must be signed in to change notification settings - Fork 85
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
Better error messages when file does not exist #184
Comments
I don't see a problem with such a change, would you be interested in submitting a PR? |
+:100: for this This has bothered me for a long time actually...
The error message should be something like:
I tried a bit to track down where/how the error message is built, but didn't succeed yet: any pointers would be helpful. |
I'm making an uneducated guess and going to say here: process/cbits/posix/runProcess.c Line 292 in 17b8a15
Edit: notably, |
Thanks @Fuuzetsu for the helpful comment: it is also confusing that the C function is also called I am still trying to work out how to move the executable name to later in the error message. |
I am wondering if this is could even be a ghc bug: maybe something like So far I tracked down from I think I need a ghc build tree to look at the generated ghc-prim files, to check what it does, though the actual final error message might still be assembled higher up in the stack. |
I don't really follow. I haven't read the code closely, but isn't it just the case of adding process/cbits/posix/runProcess.c Line 339 in 17b8a15
|
Probably and removing it from the start of the error string... |
I'm trying to figure out how the cmd name is added to the beginning. It might be this line? process/System/Process/Posix.hs Line 123 in 9410f77
And then the rest is composed here process/System/Process/Posix.hs Line 163 in 9410f77
And finally, the actual error message is extracted from the C errno by the throwErrNo function and combined with the context from the https://hackage.haskell.org/package/base-4.16.0.0/docs/src/Foreign.C.Error.html#throwErrno |
Currently, we get cryptic error messages like:
Which tells us nothing about what it is that we were trying to run that does not exist. It would be very helpful for debugging if the path that does not exist was included in the error message.
The text was updated successfully, but these errors were encountered: