diff options
| author | Andrew Chow <[email protected]> | 2019-08-02 18:04:02 -0400 |
|---|---|---|
| committer | Andrew Chow <[email protected]> | 2019-08-16 19:34:01 -0400 |
| commit | c325f619dd071b5489989f645e42cace8eb23fb4 (patch) | |
| tree | 25177eef2a597ec4bdfff5abe7782c10be5daf2f /src/rpc/util.cpp | |
| parent | Merge #15986: Add checksum to getdescriptorinfo (diff) | |
| download | discoin-c325f619dd071b5489989f645e42cace8eb23fb4.tar.xz discoin-c325f619dd071b5489989f645e42cace8eb23fb4.zip | |
Return an error from descriptor Parse that gives more information about what failed
Diffstat (limited to 'src/rpc/util.cpp')
| -rw-r--r-- | src/rpc/util.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index de9027667..52b2b9485 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -717,9 +717,10 @@ std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, Fl throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan object needs to be either a string or an object"); } - auto desc = Parse(desc_str, provider); + std::string error; + auto desc = Parse(desc_str, provider, error); if (!desc) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor '%s'", desc_str)); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor '%s', %s", desc_str, error)); } if (!desc->IsRange()) { range.first = 0; |