Skip to content

executables' error messages include Rust debug output #22

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

Closed
davepacheco opened this issue Jun 29, 2020 · 1 comment
Closed

executables' error messages include Rust debug output #22

davepacheco opened this issue Jun 29, 2020 · 1 comment

Comments

@davepacheco
Copy link
Collaborator

If you give oxide_controller a bogus config file path, you get a message that includes Rust debug output:

$ ./target/debug/oxide_controller foo
./target/debug/oxide_controller: read "foo": Os { code: 2, kind: NotFound, message: "No such file or directory" }

If you're not a Rust programmer, it's not obvious what this means (and even if you are, the Rust-specific context is more distracting than helpful). It used to look like this:

$ ./target/debug/oxide_controller foo
./target/debug/oxide_controller: read "foo": No such file or directory (os error 2)

which is intended to look like other standard tools. Take GNU grep:

$ grep foo asdf
grep: asdf: No such file or directory

This appears to have been a side effect (that I think was unintended) of 1758338 / #16. I'm going to fix this in #19, as I think it'll be easier to make the tests work if I fix this.

@davepacheco
Copy link
Collaborator Author

It would be even better if we could leave out the "(os error 2)". This would be possible by writing an unsafe wrapper around libc::strerror_r, but I'm not going to do that here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant