Merge pull request #9094 from blockscout/mf-exchange-rates-logging

Improve exchange rates logging
pull/8812/head
Victor Baranov 11 months ago committed by GitHub
commit 47f2075f2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      apps/explorer/lib/explorer/exchange_rates/source.ex

@ -42,6 +42,7 @@
### Chore
- [#9094](https://github.com/blockscout/blockscout/pull/9094) - Improve exchange rates logging
- [#9014](https://github.com/blockscout/blockscout/pull/9014) - Decrease amount of NFT in address collection: 15 -> 9
- [#8994](https://github.com/blockscout/blockscout/pull/8994) - Refactor transactions event preloads
- [#8991](https://github.com/blockscout/blockscout/pull/8991) - Manage DB queue target via runtime env var

@ -120,7 +120,7 @@ defmodule Explorer.ExchangeRates.Source do
parse_http_success_response(body)
{:ok, %Response{body: body, status_code: status_code}} when status_code in 400..526 ->
parse_http_error_response(body)
parse_http_error_response(body, status_code)
{:ok, %Response{status_code: status_code}} when status_code in 300..308 ->
{:error, "Source redirected"}
@ -139,13 +139,13 @@ defmodule Explorer.ExchangeRates.Source do
{:ok, body_json}
end
defp parse_http_error_response(body) do
defp parse_http_error_response(body, status_code) do
body_json = Helper.decode_json(body)
if is_map(body_json) do
{:error, body_json["error"]}
{:error, "#{status_code}: #{body_json["error"]}"}
else
{:error, body}
{:error, "#{status_code}: #{body}"}
end
end
end

Loading…
Cancel
Save