Page MenuHomePhabricator

RPC: make RPCResult::MatchesType return useful errors
ClosedPublic

Authored by Fabien on May 30 2024, 09:08.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCf511f93f63f7: RPC: make RPCResult::MatchesType return useful errors
Summary
Currently if you don't correctly update the description of the return value for an RPC call, you essentially just get an assertion failure with no useful information; this generates a description of the problems instead.

Backport of core#26887.

Contains a layout leftover from D16252.

Depends on D16252.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.May 30 2024, 09:08
PiRK requested changes to this revision.May 30 2024, 11:26
PiRK added a subscriber: PiRK.
PiRK added inline comments.
src/rpc/util.cpp
1040–1041 ↗(On Diff #48038)

This differs from the source material. Mistake in merge conflict resolution? You may be returning true even though you potentially pushed errors just above.

This revision now requires changes to proceed.May 30 2024, 11:26
src/rpc/util.cpp
1040–1041 ↗(On Diff #48038)

Mistake in merge conflict resolution

Very likely

Fix the rebase conflict, sneak in an unrelated change that was missed in the dependency.

This revision is now accepted and ready to land.May 30 2024, 12:38