aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorGlenn Willen <[email protected]>2019-03-06 13:22:41 -0800
committerGlenn Willen <[email protected]>2019-03-14 18:49:19 -0700
commitfaf369880822188f2738c6f046d9ef14c9585713 (patch)
treee16897d77ccb2c21bb4ba22ead17925767bcb50f /src/wallet/walletdb.cpp
parentMerge #15534: [test] lint-format-strings: open files sequentially (fix for OS X) (diff)
downloaddiscoin-faf369880822188f2738c6f046d9ef14c9585713.tar.xz
discoin-faf369880822188f2738c6f046d9ef14c9585713.zip
wallet: Improve log output for errors during load
When loading the wallet, display the entire path in error messages, instead of the name (which, for the default wallet, is the empty string.) When an exception occurs during wallet loading, display e.what() if possible, instead of nothing.
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 2783f83fd..5149bb026 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -422,8 +422,15 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
strType != "minversion" && strType != "acentry") {
wss.m_unknown_records++;
}
- } catch (...)
- {
+ } catch (const std::exception& e) {
+ if (strErr.empty()) {
+ strErr = e.what();
+ }
+ return false;
+ } catch (...) {
+ if (strErr.empty()) {
+ strErr = "Caught unknown exception in ReadKeyValue";
+ }
return false;
}
return true;