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

Handle non-installed valgrind gracefully #38

Closed
jfrimmel opened this issue Mar 17, 2021 · 0 comments · Fixed by #43
Closed

Handle non-installed valgrind gracefully #38

jfrimmel opened this issue Mar 17, 2021 · 0 comments · Fixed by #43

Comments

@jfrimmel
Copy link
Owner

In the 2.0.0 version of this crate, there is a plain panic, if valgrind is not installed or can otherwise not be run This is due to this lines (the .expect()):

let mut cargo = Command::new("valgrind")
.arg("--xml=yes")
.arg(format!("--xml-socket={}:{}", address.ip(), address.port()))
.args(command)
.spawn()
.expect("Valgrind is not installed or cannot be started");

It would be better to gracefully handle that case and print a user error, optionally with install instructions, e.g.:

$ cargo valgrind run; echo $?
error: `valgrind` is not installed, please install valgrind via your package manager.
127
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

Successfully merging a pull request may close this issue.

1 participant