Skip to content

refactor(rpc): preserve structured error responses - #434

Merged
crystalt merged 1 commit into
mainfrom
crystalbilly/refactor-lossless-json-rpc-errors
Sep 3, 2026
Merged

refactor(rpc): preserve structured error responses#434
crystalt merged 1 commit into
mainfrom
crystalbilly/refactor-lossless-json-rpc-errors

Conversation

@crystalt

@crystalt crystalt commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Makes the internal rpc_call retain the complete JSON-RPC error response, including optional structured data. Existing public RPC methods continue converting errors to the current RpcError shape, so their behavior and API remain unchanged.

This provides a lossless internal boundary for callers that need to interpret structured errors.


Note

Low Risk
Refactor of internal RPC error typing with public APIs unchanged; risk is limited to subtle error-handling regressions inside rpc_call.

Overview
Internal rpc_call now keeps full JSON-RPC errors instead of collapsing them into RpcError::RpcResponseError immediately. JSON-RPC failures return RpcCallError::Response carrying JsonRpcError (renamed from ErrorPayload), including optional structured data.

Public RPC helpers still surface RpcError via map_err(RpcError::from), so external behavior stays the same: RpcResponseError only exposes code and message (data is dropped at the API boundary). From<JsonRpcError> for RpcError encodes that mapping.

custom_bundler parsing follows the JsonRpcError rename. Tests add a stub HTTP client and assert rpc_call preserves error.data for structured declines (e.g. policy/retry hints).

Reviewed by Cursor Bugbot for commit be8c473. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T19:11:51.146081Z be8c473 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@crystalt

crystalt commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be8c4732d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bedrock/src/transactions/rpc/wire.rs
@crystalt
crystalt merged commit 32b7908 into main Sep 3, 2026
22 checks passed
@crystalt
crystalt deleted the crystalbilly/refactor-lossless-json-rpc-errors branch September 3, 2026 19:56
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