diff options
| author | Glenn Willen <[email protected]> | 2019-03-06 13:22:41 -0800 |
|---|---|---|
| committer | Glenn Willen <[email protected]> | 2019-03-14 18:49:19 -0700 |
| commit | faf369880822188f2738c6f046d9ef14c9585713 (patch) | |
| tree | e16897d77ccb2c21bb4ba22ead17925767bcb50f /src/wallet/walletdb.cpp | |
| parent | Merge #15534: [test] lint-format-strings: open files sequentially (fix for OS X) (diff) | |
| download | discoin-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.cpp | 11 |
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; |