diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-08-02 18:04:02 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-08-16 19:34:01 -0400 |
commit | c325f619dd071b5489989f645e42cace8eb23fb4 (patch) | |
tree | 25177eef2a597ec4bdfff5abe7782c10be5daf2f /src/wallet/rpcdump.cpp | |
parent | 7a960ba775a60ebcc2e830356693e3ed702b22f1 (diff) |
Return an error from descriptor Parse that gives more information about what failed
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r-- | src/wallet/rpcdump.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index a905cc0c55..fad0aefabd 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1098,9 +1098,10 @@ static UniValue ProcessImportDescriptor(ImportData& import_data, std::map<CKeyID const std::string& descriptor = data["desc"].get_str(); FlatSigningProvider keys; - auto parsed_desc = Parse(descriptor, keys, /* require_checksum = */ true); + std::string error; + auto parsed_desc = Parse(descriptor, keys, error, /* require_checksum = */ true); if (!parsed_desc) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Descriptor is invalid"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Descriptor is invalid, %s", error)); } have_solving_data = parsed_desc->IsSolvable(); |