Skip to content

Commit 286e0c7

Browse files
committed
wallet: loading, log descriptor parsing error details
The `UNKNOWN_DESCRIPTOR` error comes from the `WalletDescriptor::DeserializeDescriptor` std::ios_base exception, which contains further information about the parsing error.
1 parent 79e8247 commit 286e0c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/walletdb.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,13 @@ static DBErrors LoadDescriptorWalletRecords(CWallet* pwallet, DatabaseBatch& bat
794794
WalletDescriptor desc;
795795
try {
796796
value >> desc;
797-
} catch (const std::ios_base::failure&) {
797+
} catch (const std::ios_base::failure& e) {
798798
strErr = strprintf("Error: Unrecognized descriptor found in wallet %s. ", pwallet->GetName());
799799
strErr += (last_client > CLIENT_VERSION) ? "The wallet might had been created on a newer version. " :
800800
"The database might be corrupted or the software version is not compatible with one of your wallet descriptors. ";
801801
strErr += "Please try running the latest software version";
802+
// Also include error details
803+
strErr = strprintf("%s\nDetails: %s", strErr, e.what());
802804
return DBErrors::UNKNOWN_DESCRIPTOR;
803805
}
804806
pwallet->LoadDescriptorScriptPubKeyMan(id, desc);

0 commit comments

Comments
 (0)