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

Better error handling when accessing network interface #73

Closed
imsnif opened this issue Jan 5, 2020 · 3 comments
Closed

Better error handling when accessing network interface #73

imsnif opened this issue Jan 5, 2020 · 3 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@imsnif
Copy link
Owner

imsnif commented Jan 5, 2020

Right now this function:

fn get_datalink_channel(

Uses std::io::Error, probably not as it was intended, in order to differentiate between a permission error, a general network error and an unknown interface type (one that libpnet does not support).

It would be nice if we had our own error type for this, that would allow us to have the same functionality we have now (alerting the user that they need more permissions, recommending they run with sudo, or indicating that it could not find any interfaces to listen on).

This pattern might be a good option, though I'm not 100% sure it will fit in this case: https://rust-lang-nursery.github.io/failure/error-errorkind.html

@imsnif imsnif added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 5, 2020
@captain-yossarian
Copy link
Contributor

Hi @imsnif , can I try?

@imsnif
Copy link
Owner Author

imsnif commented Jan 9, 2020

Hi @imsnif , can I try?

Happily :)

@imsnif
Copy link
Owner Author

imsnif commented Mar 11, 2020

Done, thanks @captain-yossarian !

@imsnif imsnif closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants