-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add Error Message when wireguard-go not found. replacement for #232 #284
base: main
Are you sure you want to change the base?
Add Error Message when wireguard-go not found. replacement for #232 #284
Conversation
On a semi-related topic you might also consider adding functions to output the env-vars of WG_USERSPACE_IMPLEMENTATION, like so:
this will eliminate the same hardcoded strings in multiple locations throughout the code base. As someone who is prone to typos, this i had misspelled one of those env vars and it stumped my testing for a bit, so i thought why not just put those in a function (or a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm sorry that the PR is left unreviewed for a long time 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also sorry for an incredibly late review on this, but it looks good! I just have on minor point to address.
}, | ||
Err(e) if e.kind() == io::ErrorKind::NotFound => Err(io::Error::new( | ||
io::ErrorKind::NotFound, | ||
"Cannot find \"wireguard-go\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably pull get_userspace_implementation()
into a local var called userspace_implementation
and then use it in Command::new()
above, as well as here:
"Cannot find \"wireguard-go\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION.", | |
"Cannot find {userspace_implementation:?}. Specify a custom path with WG_USERSPACE_IMPLEMENTATION.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously when trying to add a peer, i for the following output, which
was not helpful since i wasn't sure what file could not be found.
After changes:
ref new PR to replace #232