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

Improve errors from weather #125

Closed
fhunleth opened this issue May 18, 2022 · 2 comments · Fixed by #130
Closed

Improve errors from weather #125

fhunleth opened this issue May 18, 2022 · 2 comments · Fixed by #130

Comments

@fhunleth
Copy link
Collaborator

weather is being used to check if the internet works on Nerves. Giving better error messages when the network doesn't work or DNS fails would be helpful.

@mnishiguchi
Copy link
Contributor

How about ping once within the weather/0 to check the network? We could repurpose tping/2's logic.

case resolve_addr(address) do
{:ok, ip} ->
port = Keyword.get(options, :port, 80)
ping_ip(address, ip, port, connect_options(options))
{:error, message} ->
IO.puts(message)
end

@fhunleth
Copy link
Collaborator Author

I think that I should have been more specific when writing this up. If I remember right, if you don't have internet access and try running weather, you get an exception. I was just thinking that it would be nice to catch the exception or translate the error into a friendlier message. I don't think that any network diagnostics need to be done.

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.

2 participants