diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a6a08a49..03966130ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/apps/explorer/lib/explorer/exchange_rates/source.ex b/apps/explorer/lib/explorer/exchange_rates/source.ex index 8d50d4069b..0c7a092965 100644 --- a/apps/explorer/lib/explorer/exchange_rates/source.ex +++ b/apps/explorer/lib/explorer/exchange_rates/source.ex @@ -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