aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Klitzke <evan@eklitzke.org>2018-03-09 22:39:04 -0800
committerEvan Klitzke <evan@eklitzke.org>2018-03-09 22:51:10 -0800
commitf4b68b3f8f6bb8ad45a9c13c70be0e24404ecd54 (patch)
treebeccd7f93c18b696caef9b6cab8f5dd5858edd65
parent29fad97c320c892ab6a480c81e2078ec22ab354b (diff)
Log fatal LevelDB errors more verbosely
-rw-r--r--src/dbwrapper.cpp12
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)