Skip to content

add JSONRPC error code to Client::RpcError#392

Merged
l5yth merged 1 commit intoq9f:mainfrom
achernik:main
Nov 24, 2025
Merged

add JSONRPC error code to Client::RpcError#392
l5yth merged 1 commit intoq9f:mainfrom
achernik:main

Conversation

@achernik
Copy link
Contributor

@achernik achernik commented Nov 4, 2025

Hello!
In the web app I'm working on I need to forward any RPC errors to the app's client as is (in JSON-RPC specified format). Having an RPC error code on the error raised by the Client would make it easy. Instead, I'm currently relying on calling a bunch of private methods of the client to get the raw RPC response (certainly not ideal).

If you're open to merging this in principle, please suggest the steps I need to take. Any guidance on where would you like me to put tests for this (if they are needed) is appreciated.

@q9f
Copy link
Owner

q9f commented Nov 5, 2025

I have no objections. Please either write a test for this (chatgpt is fine here) or let me know how you call or use this error code and I can see if I can add a test case myself.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.22%. Comparing base (87a01c2) to head (bf137a7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #392   +/-   ##
=======================================
  Coverage   99.22%   99.22%           
=======================================
  Files          91       91           
  Lines        6823     6831    +8     
=======================================
+ Hits         6770     6778    +8     
  Misses         53       53           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@achernik
Copy link
Contributor Author

achernik commented Nov 5, 2025

@q9f Updated the PR to add tests

@l5yth l5yth merged commit ade3432 into q9f:main Nov 24, 2025
8 checks passed
ShiningRay added a commit to ShiningRay/eth.rb that referenced this pull request Dec 24, 2025
* commit 'ab969176faf033eb0a6387b875ee3aa677c4bacf':
  build(deps): bump JamesIves/github-pages-deploy-action (q9f#395)
  build(deps): bump actions/checkout from 5 to 6 (q9f#394)
  add JSONRPC error code to Client::RpcError (q9f#392)
  Update README.md (q9f#393)
  build(deps): bump github/codeql-action from 3 to 4 (q9f#390)
  client/ws: fix client origin headers for ws requests (q9f#391)
  Rename websocket client to Ws and expand websocket tests (q9f#389)
  Add WebSocket transport to client (q9f#388)
  Support tuple arrays in ABI coder (q9f#387)
  Format EIP-4844 transaction constant (q9f#386)
  Fix ABI tuple handling for ethers test cases (q9f#385)
  Increase blob throughput limits (q9f#363)
  feat: use httpx for http requests (q9f#377) (q9f#382)
  fix: transform hash keys to strings in encoder for component type compatibility (q9f#378)
  fix: improve error handling for missing keys in component encoding (q9f#376)
  build(deps): bump actions/checkout from 4 to 5 (q9f#379)

# Conflicts:
#	eth.gemspec
#	lib/eth/client/http.rb
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.

3 participants