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

Reduce Accepted Error codes from MirrorNodeClient.ts #1746

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

AlfredoG87
Copy link
Collaborator

Description:
Currently the MirrorNodeClient.ts has a collection of Endpoints and its corresponding accepted error codes.
That instead of throwing an exception with the actual error, it will handle it and return null

The only scenario where is justified to return null instead of throwing the error is for 404 exceptions, otherwise the clients should handle the error appropriately.

Related issue(s):

Fixes #1276

Notes for reviewer:

Checklist

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

…stead of the actual error

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
@AlfredoG87 AlfredoG87 changed the title removing anything that is not 404, only 404 should default to null in… Reduce Accepted Error codes from MirrorNodeClient.ts Sep 14, 2023
@AlfredoG87 AlfredoG87 changed the title Reduce Accepted Error codes from MirrorNodeClient.ts Reduce Accepted Error codes from MirrorNodeClient.ts Sep 14, 2023
Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 15, 2023

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@AlfredoG87 AlfredoG87 marked this pull request as ready for review September 15, 2023 16:37
@AlfredoG87 AlfredoG87 self-assigned this Sep 15, 2023
@AlfredoG87 AlfredoG87 added enhancement New feature or request P2 labels Sep 15, 2023
@AlfredoG87 AlfredoG87 added this to the 0.32.0 milestone Sep 15, 2023
@AlfredoG87 AlfredoG87 merged commit 993bf0c into main Sep 18, 2023
26 checks passed
@AlfredoG87 AlfredoG87 deleted the 1276-reduce-accepted-error-codes branch September 18, 2023 16:00
ebadiere pushed a commit that referenced this pull request Sep 18, 2023
* removing anything that is not 404, only 404 should default to null instead of the actual error

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

* fixed broken unit tests

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

---------

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
Signed-off-by: ebadiere <ebadiere@gmail.com>
ebadiere pushed a commit that referenced this pull request Sep 20, 2023
* removing anything that is not 404, only 404 should default to null instead of the actual error

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

* fixed broken unit tests

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

---------

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
Signed-off-by: ebadiere <ebadiere@gmail.com>
mshakeg pushed a commit to mshakeg/hedera-json-rpc-relay that referenced this pull request Oct 18, 2023
* removing anything that is not 404, only 404 should default to null instead of the actual error

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

* fixed broken unit tests

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>

---------

Signed-off-by: Alfredo Gutierrez <alfredo@swirldslabs.com>
Signed-off-by: Mo Shaikjee <shaikjeemohammed@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce accepted error codes on mirror node contracts/call
2 participants