diff options
author | Anthony Towns <aj@erisian.com.au> | 2023-01-13 20:27:59 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2023-01-20 06:24:15 +1000 |
commit | 3d1a4d8a45cd91bdfe0ef107c2e9c5e882b34155 (patch) | |
tree | 1df5a96cea64a12ec64c533cd3ebbfc3c845ccdc /src/rpc/util.h | |
parent | f4ef856375c5b295d78169b136c6aee928c19bc9 (diff) |
RPC: make RPCResult::MatchesType return useful errors
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r-- | src/rpc/util.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h index 387fee34d3..b4c83c6cda 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -324,8 +324,10 @@ struct RPCResult { std::string ToStringObj() const; /** Return the description string, including the result type. */ std::string ToDescriptionString() const; - /** Check whether the result JSON type matches. */ - bool MatchesType(const UniValue& result) const; + /** Check whether the result JSON type matches. + * Returns true if type matches, or object describing error(s) if not. + */ + UniValue MatchesType(const UniValue& result) const; private: void CheckInnerDoc() const; |