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

add specific error classes for SDKClient and MirrorNodeCLient #382

Merged
merged 10 commits into from
Jul 27, 2022

Conversation

lukelee-sl
Copy link
Member

Signed-off-by: lukelee-sl [email protected]

Description:
Create error classes for SDKClient and MirrorNodeClient classes.

Related issue(s):

Fixes #213

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@lukelee-sl lukelee-sl self-assigned this Jul 25, 2022
Signed-off-by: lukelee-sl <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2022

Codecov Report

Merging #382 (79716e4) into main (5fd35e3) will increase coverage by 7.99%.
The diff coverage is 46.87%.

@@            Coverage Diff             @@
##             main     #382      +/-   ##
==========================================
+ Coverage   65.66%   73.65%   +7.99%     
==========================================
  Files           8       10       +2     
  Lines         798      820      +22     
  Branches      130      133       +3     
==========================================
+ Hits          524      604      +80     
+ Misses        237      170      -67     
- Partials       37       46       +9     
Impacted Files Coverage Δ
packages/relay/src/lib/errors/JsonRpcError.ts 85.71% <ø> (ø)
packages/relay/src/lib/clients/sdkClient.ts 7.54% <5.55%> (+1.00%) ⬆️
packages/relay/src/lib/eth.ts 81.44% <48.00%> (+12.51%) ⬆️
packages/relay/src/lib/errors/SDKClientError.ts 71.42% <71.42%> (ø)
packages/relay/src/lib/clients/mirrorNodeClient.ts 86.02% <100.00%> (ø)
...ages/relay/src/lib/errors/MirrorNodeClientError.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/precheck.ts 89.39% <100.00%> (+19.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fd35e3...79716e4. Read the comment docs.

ar-conmit
ar-conmit previously approved these changes Jul 26, 2022
Copy link
Collaborator

@ar-conmit ar-conmit left a comment

Choose a reason for hiding this comment

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

LG

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Nice start.
Let's move some of the logic into the error class files

packages/relay/src/lib/errors.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Show resolved Hide resolved
packages/relay/src/lib/errors.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/errors.ts Outdated Show resolved Hide resolved
Signed-off-by: lukelee-sl <[email protected]>
@lukelee-sl lukelee-sl requested a review from Nana-EC July 26, 2022 18:13
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Almost there. 1 modification 2 nits

packages/relay/src/lib/errors/JsonRpcError.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/errors/MirrorNodeClientError.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
Signed-off-by: lukelee-sl <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Jul 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lukelee-sl lukelee-sl requested a review from Nana-EC July 26, 2022 22:20
@lukelee-sl lukelee-sl merged commit 61ae4d4 into main Jul 27, 2022
@lukelee-sl lukelee-sl deleted the 213-add-client-error-classes branch July 27, 2022 04:52
@Nana-EC Nana-EC added enhancement New feature or request P3 labels Aug 4, 2022
@Nana-EC Nana-EC added this to In progress in Development via automation Aug 4, 2022
@Nana-EC Nana-EC added this to the 0.5.0 milestone Aug 4, 2022
@Nana-EC Nana-EC moved this from In progress to Done in Development Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add client error classes to streamline error handling
4 participants