Changeset 2896 for box/trunk/lib/raidfile
- Timestamp:
- 27/03/2011 21:30:43 (14 months ago)
- File:
-
- 1 edited
-
box/trunk/lib/raidfile/RaidFileWrite.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/raidfile/RaidFileWrite.cpp
r2890 r2896 134 134 if(existance != RaidFileUtil::NoFile) 135 135 { 136 BOX_ERROR("Attempted to overwrite raidfile " <<137 mSetNumber << " " << mFilename);138 THROW_EXCEPTION(RaidFileException, CannotOverwriteExistingFile)136 THROW_FILE_ERROR("Attempted to overwrite raidfile " << 137 mSetNumber, mFilename, RaidFileException, 138 CannotOverwriteExistingFile); 139 139 } 140 140 } … … 151 151 if(mOSFileHandle == -1) 152 152 { 153 BOX_LOG_SYS_ERROR("Failed to open file: " << writeFilename);154 THROW_EXCEPTION(RaidFileException, ErrorOpeningWriteFile)153 THROW_SYS_FILE_ERROR("Failed to open RaidFile", writeFilename, 154 RaidFileException, ErrorOpeningWriteFile); 155 155 } 156 156 … … 318 318 #ifdef WIN32 319 319 // need to delete the target first 320 if(::unlink(renameTo.c_str()) != 0 && 321 GetLastError() != ERROR_FILE_NOT_FOUND) 322 { 323 BOX_LOG_WIN_ERROR("Failed to delete file: " << renameTo); 324 THROW_EXCEPTION(RaidFileException, OSError) 320 if(::unlink(renameTo.c_str()) != 0) 321 { 322 DWORD errorNumber = GetLastError(); 323 if (errorNumber != ERROR_FILE_NOT_FOUND) 324 { 325 THROW_WIN_FILE_ERRNO("Failed to delete file", renameTo, 326 errorNumber, RaidFileException, OSError); 327 } 325 328 } 326 329 #endif … … 328 331 if(::rename(renameFrom.c_str(), renameTo.c_str()) != 0) 329 332 { 330 BOX_LOG_SYS_ERROR("Failed to rename file: " << renameFrom << 331 " to " << renameTo); 332 THROW_EXCEPTION(RaidFileException, OSError) 333 THROW_SYS_ERROR("Failed to rename file: " << renameFrom << 334 " to " << renameTo, RaidFileException, OSError); 333 335 } 334 336 … … 810 812 { 811 813 // No. Bad things. 812 THROW_EXCEPTION(RaidFileException, FileExistsInDirectoryCreation) 814 THROW_FILE_ERROR("Failed to create RaidFile directory", 815 dn, RaidFileException, FileExistsInDirectoryCreation); 813 816 } 814 817 else 815 818 { 816 THROW_EXCEPTION(RaidFileException, OSError) 819 THROW_FILE_ERROR("Failed to create RaidFile directory", 820 dn, RaidFileException, OSError); 817 821 } 818 822 }
Note: See TracChangeset
for help on using the changeset viewer.
