mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 19:19:41 +01:00
log: Use LogError for fatal errors
This commit is contained in:
@@ -47,8 +47,8 @@ static void HandleError(const leveldb::Status& status)
|
||||
if (status.ok())
|
||||
return;
|
||||
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");
|
||||
LogError("%s", errmsg);
|
||||
LogInfo("You can use -debug=leveldb to get more complete diagnostic messages");
|
||||
throw dbwrapper_error(errmsg);
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ std::optional<std::string> CDBWrapper::ReadImpl(std::span<const std::byte> key)
|
||||
if (!status.ok()) {
|
||||
if (status.IsNotFound())
|
||||
return std::nullopt;
|
||||
LogPrintf("LevelDB read failure: %s\n", status.ToString());
|
||||
LogError("LevelDB read failure: %s", status.ToString());
|
||||
HandleError(status);
|
||||
}
|
||||
return strValue;
|
||||
@@ -324,7 +324,7 @@ bool CDBWrapper::ExistsImpl(std::span<const std::byte> key) const
|
||||
if (!status.ok()) {
|
||||
if (status.IsNotFound())
|
||||
return false;
|
||||
LogPrintf("LevelDB read failure: %s\n", status.ToString());
|
||||
LogError("LevelDB read failure: %s", status.ToString());
|
||||
HandleError(status);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user