summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreInfo.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-06-16 15:45:26 +0000
committerChris Wilson <chris+github@qwirx.com>2011-06-16 15:45:26 +0000
commit8ad29b4e5ded759dd93932d35229d2858d14839c (patch)
treea6757875d31e10fe860b837771b471de5d887cf7 /lib/backupstore/BackupStoreInfo.cpp
parent613c2e58676ff19d8ecf86df753b987a9eefdb26 (diff)
Improve error logging for store info and refcount database errors.
Diffstat (limited to 'lib/backupstore/BackupStoreInfo.cpp')
-rw-r--r--lib/backupstore/BackupStoreInfo.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/backupstore/BackupStoreInfo.cpp b/lib/backupstore/BackupStoreInfo.cpp
index cc4d2b35..6c7a3758 100644
--- a/lib/backupstore/BackupStoreInfo.cpp
+++ b/lib/backupstore/BackupStoreInfo.cpp
@@ -141,7 +141,9 @@ void BackupStoreInfo::CreateNew(int32_t AccountID, const std::string &rRootDir,
// Created: 2003/08/28
//
// --------------------------------------------------------------------------
-std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, const std::string &rRootDir, int DiscSet, bool ReadOnly, int64_t *pRevisionID)
+std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID,
+ const std::string &rRootDir, int DiscSet, bool ReadOnly,
+ int64_t *pRevisionID)
{
// Generate the filename
std::string fn(rRootDir + INFO_FILENAME);
@@ -153,7 +155,9 @@ std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, const st
int32_t magic;
if(!rf->ReadFullBuffer(&magic, sizeof(magic), 0))
{
- THROW_EXCEPTION(BackupStoreException, CouldNotLoadStoreInfo);
+ THROW_FILE_ERROR("Failed to read store info file: "
+ "short read of magic number", fn,
+ BackupStoreException, CouldNotLoadStoreInfo);
}
bool v1 = false, v2 = false;
@@ -168,7 +172,9 @@ std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, const st
}
else
{
- THROW_EXCEPTION(BackupStoreException, BadStoreInfoOnLoad)
+ THROW_FILE_ERROR("Failed to read store info file: "
+ "unknown magic " << BOX_FORMAT_HEX32(ntohl(magic)),
+ fn, BackupStoreException, BadStoreInfoOnLoad);
}
// Make new object
@@ -223,7 +229,8 @@ std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, const st
archive.Read(FileAccountID);
if (FileAccountID != AccountID)
{
- THROW_FILE_ERROR("Found wrong account ID in store info",
+ THROW_FILE_ERROR("Found wrong account ID in store "
+ "info: " << BOX_FORMAT_HEX32(FileAccountID),
fn, BackupStoreException, BadStoreInfoOnLoad);
}