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: handle JSON-RPC errors from score-api #899

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Sep 18, 2023

🧿 Current issues / What's wrong ?

The getScores function does not take into account when the score-api is returning a json-rpc error object.

💊 Fixes / Solution

Handle case when score-api is returning a json-rpc error object.

🚧 Changes

  • Add an if condition to return a promise rejection with the json-rpc error object when present.

🛠️ Tests

  • Trigger the getScores function with dummy data, which will be handled and rejected by score-api
  • It should return a promise rejection, with the JSON-RPC error object

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: +1.53% 🎉

Comparison is base (73a6e41) 44.17% compared to head (0c78321) 45.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #899      +/-   ##
==========================================
+ Coverage   44.17%   45.71%   +1.53%     
==========================================
  Files          22       22              
  Lines        2001     2006       +5     
  Branches      187      191       +4     
==========================================
+ Hits          884      917      +33     
+ Misses       1108     1079      -29     
- Partials        9       10       +1     
Files Changed Coverage Δ
src/utils.ts 35.55% <80.00%> (+6.19%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

@ChaituVR ChaituVR merged commit 3daf54a into master Sep 19, 2023
4 checks passed
@ChaituVR ChaituVR deleted the reject-on-getscores-error branch September 19, 2023 13:01
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.

2 participants