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

Open
imsnif opened this issue Jan 5, 2020 · 2 comments
Open

Better error handling when accessing network interface #73

imsnif opened this issue Jan 5, 2020 · 2 comments
Assignees

Comments

@imsnif
Copy link
Owner

@imsnif 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

@SerhiiBilyk

This comment has been minimized.

Copy link

@SerhiiBilyk SerhiiBilyk commented Jan 9, 2020

Hi @imsnif , can I try?

@imsnif

This comment has been minimized.

Copy link
Owner Author

@imsnif imsnif commented Jan 9, 2020

Hi @imsnif , can I try?

Happily :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.