diff options
author | Evan Klitzke <evan@eklitzke.org> | 2018-03-09 22:39:04 -0800 |
---|---|---|
committer | Evan Klitzke <evan@eklitzke.org> | 2018-03-09 22:51:10 -0800 |
commit | f4b68b3f8f6bb8ad45a9c13c70be0e24404ecd54 (patch) | |
tree | beccd7f93c18b696caef9b6cab8f5dd5858edd65 /src | |
parent | 29fad97c320c892ab6a480c81e2078ec22ab354b (diff) |
Log fatal LevelDB errors more verbosely
Diffstat (limited to 'src')
-rw-r--r-- | src/dbwrapper.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index 6cac625abc..fb0d4215a2 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -218,14 +218,10 @@ void HandleError(const leveldb::Status& status) { if (status.ok()) return; - LogPrintf("%s\n", status.ToString()); - if (status.IsCorruption()) - throw dbwrapper_error("Database corrupted"); - if (status.IsIOError()) - throw dbwrapper_error("Database I/O error"); - if (status.IsNotFound()) - throw dbwrapper_error("Database entry missing"); - throw dbwrapper_error("Unknown database error"); + const std::string errmsg = "Fatal LevelDB error: " + status.ToString(); + LogPrintf("%s\n", errmsg); + LogPrintf("You can use -debug=leveldb to get more complete diagnostic messages\n"); + throw dbwrapper_error(errmsg); } const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w) |