refactor: Use error types from rpc-spec - #3173
Merged
godexsoft merged 14 commits intoSep 8, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
mathbunnyru
requested changes
Aug 26, 2026
mathbunnyru
reviewed
Aug 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors Clio’s RPC error handling to rely on the shared xrpl-rpc-spec error model, keeping Clio-specific rendering helpers and updating call sites/tests to use the spec types and renamed forwarding error codes.
Changes:
- Replaced most direct usage of Clio-defined RPC error types with
<rpcspec/Errors.hpp>and updated forwarding-related errors fromEtl*toRpcForwarding*. - Updated the wire-visible “validated data” warning text to reference xrpld instead of rippled, and adjusted unit tests accordingly.
- Bumped
xrpl-rpc-specdependency to0.1.7and linkedrpcspec::rpcspecwhere needed.
Reviewed changes
Copilot reviewed 84 out of 85 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/web/RPCServerHandlerTests.cpp | Update warning message expectation; switch to rpcspec header include. |
| tests/unit/web/ng/RPCServerHandlerTests.cpp | Replace Clio Errors include with rpcspec include. |
| tests/unit/web/ng/impl/ErrorHandlingTests.cpp | Replace Clio Errors include with rpcspec include. |
| tests/unit/web/LoadWarningTests.cpp | Replace Clio Errors include with rpcspec include. |
| tests/unit/web/impl/ErrorHandlingTests.cpp | Replace Clio Errors include with rpcspec include. |
| tests/unit/rpc/RPCHelpersTests.cpp | Add rpcspec errors include for updated error model. |
| tests/unit/rpc/RPCEngineTests.cpp | Switch to rpcspec errors include. |
| tests/unit/rpc/handlers/VaultInfoTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/UnsubscribeTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/TxTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/TestHandlerTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/SubscribeTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/ServerInfoTests.cpp | Add rpcspec errors include; update forwarding error expectations. |
| tests/unit/rpc/handlers/LedgerTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/LedgerEntryTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/LedgerDataTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/CredentialHelpersTests.cpp | Switch to rpcspec errors include. |
| tests/unit/rpc/handlers/AccountOffersTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/AccountLinesTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/AccountInfoTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/handlers/AccountCurrenciesTests.cpp | Add rpcspec errors include. |
| tests/unit/rpc/ForwardingProxyTests.cpp | Switch to rpcspec errors include; update forwarding error expectations. |
| tests/unit/rpc/ErrorTests.cpp | Add rpcspec errors include; update warning text and forwarding error codes. |
| tests/unit/rpc/common/TypesTests.cpp | Drop direct Clio Errors include (Types already pulls it in). |
| tests/unit/rpc/common/SpecsTests.cpp | Switch to rpcspec errors include. |
| tests/unit/rpc/common/CheckersTests.cpp | Switch to rpcspec errors include. |
| tests/unit/rpc/BaseTests.cpp | Switch to rpcspec errors include. |
| tests/unit/etl/SourceImplTests.cpp | Switch to rpcspec errors include. |
| tests/unit/etl/LoadBalancerTests.cpp | Switch to rpcspec errors include; update forwarding error expectations. |
| tests/unit/etl/ForwardingSourceTests.cpp | Switch to rpcspec errors include; update forwarding error expectations. |
| tests/unit/etl/ETLStateTests.cpp | Switch to rpcspec errors include; update forwarding error expectations. |
| tests/unit/app/WebHandlersTests.cpp | Switch to rpcspec errors include. |
| tests/common/util/MockSource.hpp | Switch to rpcspec errors include. |
| src/web/ng/impl/ErrorHandling.cpp | Update forwarding error enum names; include rpcspec errors. |
| src/web/impl/ErrorHandling.hpp | Update forwarding error enum names. |
| src/web/CMakeLists.txt | Link rpcspec library into web target. |
| src/rpc/RPCHelpers.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/VaultInfo.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/Unsubscribe.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/TransactionEntry.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/Subscribe.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/NoRippleCheck.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/NFTsByIssuer.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/NFTOffersCommon.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/NFTInfo.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/NFTHistory.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/MPTokenIssuanceHistory.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/MPTHolders.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/LedgerIndex.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/LedgerEntry.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/LedgerData.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/GetAggregatePrice.cpp | Remove Clio Errors include (no longer needed). |
| src/rpc/handlers/GatewayBalances.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/Feature.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/DepositAuthorized.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AMMInfo.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountTx.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountOffers.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountObjects.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountNFTs.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountMPTokens.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountMPTokenIssuances.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountLines.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountInfo.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountCurrencies.cpp | Switch to rpcspec errors include. |
| src/rpc/handlers/AccountChannels.cpp | Switch to rpcspec errors include. |
| src/rpc/Factories.cpp | Switch to rpcspec errors include. |
| src/rpc/Errors.hpp | Convert to shim over rpcspec errors; keep Clio-side rendering surface. |
| src/rpc/Errors.cpp | Move remaining Clio-only error-info table; use std::to_array/ranges::find; update forwarding error names. |
| src/rpc/CredentialHelpers.cpp | Switch to rpcspec errors include. |
| src/rpc/common/Validators.cpp | Switch to rpcspec errors include. |
| src/rpc/common/Specs.hpp | Docstring tweaks referencing Status. |
| src/rpc/common/Specs.cpp | Switch to rpcspec errors include. |
| src/rpc/common/MetaProcessors.cpp | Switch to rpcspec errors include. |
| src/rpc/common/AnyHandler.hpp | Docstring tweak referencing Status. |
| src/feed/CMakeLists.txt | Link rpcspec library into feed target. |
| src/etl/Source.hpp | Switch to rpcspec errors include for forwarding error type usage. |
| src/etl/LoadBalancer.cpp | Update default forwarding error code to renamed RpcForwarding*. |
| src/etl/impl/SourceImpl.hpp | Switch to rpcspec errors include. |
| src/etl/impl/ForwardingSource.hpp | Switch to rpcspec errors include. |
| src/etl/impl/ForwardingSource.cpp | Rename forwarding error returns to RpcForwarding*. |
| src/etl/CMakeLists.txt | Link rpcspec library into etl target. |
| src/app/WebHandlers.cpp | Add rpcspec errors include. |
| conanfile.py | Bump xrpl-rpc-spec dependency to 0.1.7. |
| conan.lock | Update lockfile entry for xrpl-rpc-spec/0.1.7. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mathbunnyru
reviewed
Aug 27, 2026
mathbunnyru
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is PR 3 out of many. It depends on merging #3171 first.
Moves the RPC error model into the shared spec library.
src/rpc/Errors.hppbecomes a shim over<rpcspec/Errors.hpp>, keeping only the Clio-side rendering:makeError,getErrorInfo,getEtlErrorInfo.ClioError::Etl*is carved out into a Clio-sideetl::EtlError(newsrc/etl/Errors.hpp), since ETL codes aren't an RPC-spec concern.Source::forwardToRipplednow returnsEtlErrorinstead ofClioError, which is what most of the diff is.Wire-visible change: the "clio only serves validated data" warning now says "if you want to talk to xrpld" instead of "rippled" — the string moved into rpcspec, which renamed it. 10 expectations updated in
RPCServerHandlerTests.cpp.Drive-by cleanups:
InvalidParamsErrorandAccountNotFoundError- unreferenced anywhere insrc/ortests/.std::to_array+ranges::findwith a projection.