dbwrapper: Move HandleError to dbwrapper_private

HandleError is implementation-specific.
This commit is contained in:
Wladimir J. van der Laan
2016-04-20 11:48:57 +02:00
committed by Jack Grigg
parent 809a429ecf
commit 3923bcca7c
3 changed files with 35 additions and 23 deletions

View File

@@ -22,9 +22,17 @@ public:
dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
};
class CDBWrapper;
/** These should be considered an implementation detail of the specific database.
*/
namespace dbwrapper_private {
/** Handle database error by throwing dbwrapper_error exception.
*/
void HandleError(const leveldb::Status& status);
class CDBWrapper;
};
/** Batch of changes queued to be written to a CDBWrapper */
class CDBBatch
@@ -179,7 +187,7 @@ public:
if (status.IsNotFound())
return false;
LogPrintf("LevelDB read failure: %s\n", status.ToString());
HandleError(status);
dbwrapper_private::HandleError(status);
}
try {
CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION);
@@ -212,7 +220,7 @@ public:
if (status.IsNotFound())
return false;
LogPrintf("LevelDB read failure: %s\n", status.ToString());
HandleError(status);
dbwrapper_private::HandleError(status);
}
return true;
}