Skip to content

Commit f4b68b3

Browse files
committed
Log fatal LevelDB errors more verbosely
1 parent 29fad97 commit f4b68b3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/dbwrapper.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,10 @@ void HandleError(const leveldb::Status& status)
218218
{
219219
if (status.ok())
220220
return;
221-
LogPrintf("%s\n", status.ToString());
222-
if (status.IsCorruption())
223-
throw dbwrapper_error("Database corrupted");
224-
if (status.IsIOError())
225-
throw dbwrapper_error("Database I/O error");
226-
if (status.IsNotFound())
227-
throw dbwrapper_error("Database entry missing");
228-
throw dbwrapper_error("Unknown database error");
221+
const std::string errmsg = "Fatal LevelDB error: " + status.ToString();
222+
LogPrintf("%s\n", errmsg);
223+
LogPrintf("You can use -debug=leveldb to get more complete diagnostic messages\n");
224+
throw dbwrapper_error(errmsg);
229225
}
230226

231227
const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w)

0 commit comments

Comments
 (0)