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

Coinprice api endpoint: handle nil rates #3728

Merged
merged 2 commits into from
Mar 21, 2021
Merged

Coinprice api endpoint: handle nil rates #3728

merged 2 commits into from
Mar 21, 2021

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Mar 21, 2021

Motivation

2021-03-21T15:36:54.476 application=block_scout_web request_id=Fm5llsNt_47yDO4AAEYE [error] Error while calling RPC action"** (Plug.Conn.WrapperError) ** (UndefinedFunctionError) function nil.last_updated/0 is undefined\n nil.last_updated()\n (block_scout_web 0.0.1) lib/block_scout_web/views/api/rpc/stats_view.ex:31: BlockScoutWeb.API.RPC.StatsView.prepare_rates/1\n (block_scout_web 0.0.1) lib/block_scout_web/views/api/rpc/stats_view.ex:23: BlockScoutWeb.API.RPC.StatsView.render/2\n (phoenix 1.5.6) lib/phoenix/view.ex:472: Phoenix.View.render_to_iodata/3\n (phoenix 1.5.6) lib/phoenix/controller.ex:776: Phoenix.Controller.render_and_send/4\n (block_scout_web 0.0.1) lib/block_scout_web/controllers/api/rpc/stats_controller.ex:1: BlockScoutWeb.API.RPC.StatsController.action/2\n (block_scout_web 0.0.1) lib/block_scout_web/controllers/api/rpc/stats_controller.ex:1: BlockScoutWeb.API.RPC.StatsController.phoenix_controller_pipeline/2\n (block_scout_web 0.0.1) lib/block_scout_web/controllers/api/rpc/rpc_translator.ex:101: BlockScoutWeb.API.RPC.RPCTranslator.call_controller/3\n"

Changelog

Check rates are not null object before return its data in coinprice API endpoint

Checklist for your Pull Request (PR)

@coveralls
Copy link

coveralls commented Mar 21, 2021

Pull Request Test Coverage Report for Build 32db2883ca1700473b1012a64c0e9937ce1e6c4f-PR-3728

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.4%) to 64.641%

Files with Coverage Reduction New Missed Lines %
lib/block_scout_web/views/api/rpc/stats_view.ex 1 75.0%
test/block_scout_web/features/pages/chain_page.ex 1 90.0%
Totals Coverage Status
Change from base Build 6c56cbde1e195446c570035d10ec2d4ea01034b1: 0.4%
Covered Lines: 2117
Relevant Lines: 3275

💛 - Coveralls

@vbaranov vbaranov merged commit 0d0ebfb into master Mar 21, 2021
@vbaranov vbaranov deleted the vb-fix-error branch March 21, 2021 18:25
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.

None yet

2 participants