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

fix coinmarketcap errors #2175

Merged
merged 4 commits into from
Jun 17, 2019
Merged

fix coinmarketcap errors #2175

merged 4 commits into from
Jun 17, 2019

Conversation

ayrat555
Copy link
Contributor

fixes

2019-06-14T07:30:36.226 [error] Task #PID<0.16142.65> started from Explorer.ExchangeRates terminating
** (CaseClauseError) no case clause matching: {:ok, %HTTPoison.Response{body: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>cloudflare</center>\r\n</body>\r\n</html>\r\n", headers: [{"Server", "cloudflare"}, {"Date", "Fri, 14 Jun 2019 07:30:36 GMT"}, {"Content-Type", "text/html"}, {"Content-Length", "171"}, {"Connection", "keep-alive"}, {"CF-RAY", "4e6a99904cfccee0-IAD"}], request: %HTTPoison.Request{body: "", headers: [{"Content-Type", "application/json"}], method: :get, options: [], params: %{}, url: "https://api.coinmarketcap.com/v1/ticker/?start=600"}, request_url: "https://api.coinmarketcap.com/v1/ticker/?start=600", status_code: 502}}
    (explorer) lib/explorer/exchange_rates/source.ex:23: Explorer.ExchangeRates.Source.fetch_exchange_rates_from_paginable_source/2
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.14719208/0 in Explorer.ExchangeRates.fetch_rates/0>
    Args: []

and

2019-06-14T09:53:56.520 [error] Task #PID<0.6613.71> started from Explorer.ExchangeRates terminating
** (Jason.DecodeError) unexpected byte at position 0: 0x3C ('<')
    (jason) lib/jason.ex:78: Jason.decode!/2
    (explorer) lib/explorer/exchange_rates/source.ex:32: Explorer.ExchangeRates.Source.fetch_exchange_rates_from_paginable_source/2
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.14719208/0 in Explorer.ExchangeRates.fetch_rates/0>
    Args: []

Motivation

  • Coinmarketcap can respond with 502 status code
  • Coinmarketcap can return HTML in body

Changelog

  • fix coinmarketcap errors

@coveralls
Copy link

coveralls commented Jun 14, 2019

Pull Request Test Coverage Report for Build 17fea258-7da4-448d-a9a1-c6b6089ff49e

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 80.715%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/exchange_rates/source.ex 0 1 0.0%
Totals Coverage Status
Change from base Build ff797734-82d5-464b-9408-e1ad377814b1: -0.01%
Covered Lines: 4922
Relevant Lines: 6098

💛 - Coveralls

@vbaranov vbaranov merged commit b38121f into master Jun 17, 2019
@vbaranov vbaranov deleted the ab-fix-excange-rates-errors branch June 17, 2019 17:28
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.

5 participants