-
Notifications
You must be signed in to change notification settings - Fork 196
Make it easier to debug path parsing failures #869
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
Comments
Do you have any suggestions for which code to use? I can see how For what it''s worth, So, another option would be to have functions that take path arguments use a different error type, which could be an enum containing either an |
I think that this could be solved by taking advantage of the fact that there are many unused error codes.
Specifically, in both cases, there is a surefire way to tell if something is an actual system error code:
For the conversions in
Ignoring the third error, let's say we use a one-bit determinant to decide between the first two errors. This leaves us with 14 bits to hold the index at which path processing failed; either the zero in the Thoughts on this? We potentially ran into this issue as a part of dbus2/zbus#517, which makes it the second time I've stepped on this particular footgun. |
I have a non-trivial bit of code using
rustix
that is returningEINVAL
. I thought it was an OS error, but it turns out that I was getting rust-lang/rust#116523. However it was being masked by the fact thatArg
impl returnsEINVAL
if there is a\0
in the path bytes. It would be nice ifrustix
returned an error code less plausible thanEINVAL
when a path failure like this happens.The text was updated successfully, but these errors were encountered: