Changeset 2968
- Timestamp:
- 16/06/2011 16:45:26 (11 months ago)
- Location:
- box/trunk/lib/backupstore
- Files:
-
- 2 edited
-
BackupStoreInfo.cpp (modified) (4 diffs)
-
BackupStoreRefCountDatabase.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/backupstore/BackupStoreInfo.cpp
r2903 r2968 142 142 // 143 143 // -------------------------------------------------------------------------- 144 std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, const std::string &rRootDir, int DiscSet, bool ReadOnly, int64_t *pRevisionID) 144 std::auto_ptr<BackupStoreInfo> BackupStoreInfo::Load(int32_t AccountID, 145 const std::string &rRootDir, int DiscSet, bool ReadOnly, 146 int64_t *pRevisionID) 145 147 { 146 148 // Generate the filename … … 154 156 if(!rf->ReadFullBuffer(&magic, sizeof(magic), 0)) 155 157 { 156 THROW_EXCEPTION(BackupStoreException, CouldNotLoadStoreInfo); 158 THROW_FILE_ERROR("Failed to read store info file: " 159 "short read of magic number", fn, 160 BackupStoreException, CouldNotLoadStoreInfo); 157 161 } 158 162 … … 169 173 else 170 174 { 171 THROW_EXCEPTION(BackupStoreException, BadStoreInfoOnLoad) 175 THROW_FILE_ERROR("Failed to read store info file: " 176 "unknown magic " << BOX_FORMAT_HEX32(ntohl(magic)), 177 fn, BackupStoreException, BadStoreInfoOnLoad); 172 178 } 173 179 … … 224 230 if (FileAccountID != AccountID) 225 231 { 226 THROW_FILE_ERROR("Found wrong account ID in store info", 232 THROW_FILE_ERROR("Found wrong account ID in store " 233 "info: " << BOX_FORMAT_HEX32(FileAccountID), 227 234 fn, BackupStoreException, BadStoreInfoOnLoad); 228 235 } -
box/trunk/lib/backupstore/BackupStoreRefCountDatabase.cpp
r2932 r2968 92 92 if (FileExists(Filename) && !AllowOverwrite) 93 93 { 94 BOX_ERROR("Attempted to overwrite refcount database file: " <<95 Filename);96 THROW_EXCEPTION(RaidFileException,CannotOverwriteExistingFile);94 THROW_FILE_ERROR("Failed to overwrite refcount database: " 95 "not allowed here", Filename, RaidFileException, 96 CannotOverwriteExistingFile); 97 97 } 98 98 … … 135 135 if(!dbfile->ReadFullBuffer(&hdr, sizeof(hdr), 0 /* not interested in bytes read if this fails */)) 136 136 { 137 THROW_EXCEPTION(BackupStoreException, CouldNotLoadStoreInfo) 137 THROW_FILE_ERROR("Failed to read refcount database: " 138 "short read", filename, BackupStoreException, 139 CouldNotLoadStoreInfo); 138 140 } 139 141 … … 142 144 (int32_t)ntohl(hdr.mAccountID) != rAccount.GetID()) 143 145 { 144 THROW_EXCEPTION(BackupStoreException, BadStoreInfoOnLoad) 146 THROW_FILE_ERROR("Failed to read refcount database: " 147 "bad magic number", filename, BackupStoreException, 148 BadStoreInfoOnLoad); 145 149 } 146 150 … … 256 260 if (GetSize() < offset + GetEntrySize()) 257 261 { 258 BOX_ERROR("attempted read of unknown refcount for object " <<259 BOX_FORMAT_OBJECTID(ObjectID));260 THROW_EXCEPTION(BackupStoreException,261 UnknownObjectRefCountRequested);262 THROW_FILE_ERROR("Failed to read refcount database: " 263 "attempted read of unknown refcount for object " << 264 BOX_FORMAT_OBJECTID(ObjectID), mFilename, 265 BackupStoreException, UnknownObjectRefCountRequested); 262 266 } 263 267 … … 268 272 sizeof(refcount)) 269 273 { 270 BOX_LOG_SYS_ERROR("short read on refcount database: " <<271 mFilename);272 THROW_EXCEPTION(BackupStoreException, CouldNotLoadStoreInfo);274 THROW_FILE_ERROR("Failed to read refcount database: " 275 "short read at offset " << offset, mFilename, 276 BackupStoreException, CouldNotLoadStoreInfo); 273 277 } 274 278
Note: See TracChangeset
for help on using the changeset viewer.
