Log fatal LevelDB errors more verbosely
This commit is contained in:
parent
29fad97c32
commit
f4b68b3f8f
1 changed files with 4 additions and 8 deletions
|
@ -218,14 +218,10 @@ void HandleError(const leveldb::Status& status)
|
||||||
{
|
{
|
||||||
if (status.ok())
|
if (status.ok())
|
||||||
return;
|
return;
|
||||||
LogPrintf("%s\n", status.ToString());
|
const std::string errmsg = "Fatal LevelDB error: " + status.ToString();
|
||||||
if (status.IsCorruption())
|
LogPrintf("%s\n", errmsg);
|
||||||
throw dbwrapper_error("Database corrupted");
|
LogPrintf("You can use -debug=leveldb to get more complete diagnostic messages\n");
|
||||||
if (status.IsIOError())
|
throw dbwrapper_error(errmsg);
|
||||||
throw dbwrapper_error("Database I/O error");
|
|
||||||
if (status.IsNotFound())
|
|
||||||
throw dbwrapper_error("Database entry missing");
|
|
||||||
throw dbwrapper_error("Unknown database error");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w)
|
const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w)
|
||||||
|
|
Loading…
Reference in a new issue