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

Misleading error message when using non-en0 interface on macOS #82

Open
fwcd opened this issue Sep 19, 2022 · 1 comment
Open

Misleading error message when using non-en0 interface on macOS #82

fwcd opened this issue Sep 19, 2022 · 1 comment

Comments

@fwcd
Copy link

fwcd commented Sep 19, 2022

Calling local_ip() on macOS when using e.g. en1 instead of en0 (with the latter not being assigned an IP at all) yields the following, slightly misleading error message:

PlatformNotSupported("macos")

Perhaps the library could try en0, en1, ... in order until it finds an IP address and, if not, throw an error along the lines of "No interface with an IP address found"?

@EstebanBorai
Copy link
Owner

Hi @fwcd, thanks for opening this issue!

I agree, the current error message it's confusing.
Let me check on other approaches, when I updated the Linux approach to use neli I wondered if there's any similar approach
for macOS that doesn't rely on interface name.

As of today errors are standardized which means that I have to keep all errors the same for supported targets, we could have complaints on match cases when building on macOS for multi target projects if I added another error message for this specialized scenario.

I think I could, research on other ways to retrieve the default gateway on macOS, and then, update the approach so we don't rely on the interface name anymore.

What do you think?

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

2 participants