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 weather/0 #130

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

mnishiguchi
Copy link
Contributor

@mnishiguchi mnishiguchi commented Jun 30, 2022

@fhunleth I tentatively prototyped #125 with #60 in mind.

Changes

  • extract weather/0 command from Toolshed.HTTP, newly creating Toolshed.Weather
  • extract check_app/1 helper from Toolshed.HTTP, newly creating Toolshed.Utils
  • catch :exit signal that potentially occurs when :httpc server crashes
  • rescue unexpected responses

Notes

  • I was able to recreate two types of potential errors on my local machine
    • :https server crashing, which throws :exit
    • :https responds with unexpected response, which is currently anything but {:ok, {_, _, _}}
  • I have trouble wording errors so it would be great if you come up with better messages.
  • resolves Improve errors from weather #125

@mnishiguchi mnishiguchi force-pushed the mnishiguchi/weather-errors branch 3 times, most recently from 1597d83 to ee49233 Compare June 30, 2022 11:15
@fhunleth
Copy link
Collaborator

I think this is good. Thank you!

When we hit errors in our day-to-day use, we can fine tune the error messages if that's needed.

@fhunleth fhunleth merged commit 66ca1e5 into elixir-toolshed:main Jun 30, 2022
@mnishiguchi mnishiguchi deleted the mnishiguchi/weather-errors branch June 30, 2022 14:42
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 this pull request may close these issues.

Improve errors from weather
2 participants