summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-06-27 11:28:15 +0000
committerChris Wilson <chris+github@qwirx.com>2009-06-27 11:28:15 +0000
commit772b9f79c3865f02d97b926960e22d50ca56c9b8 (patch)
tree70d109481ce5289b4f58e8f5b17891107d6d2f78
parente056f96b24affd8d18ba441e7993e83836655e4c (diff)
Improve RaidFileWrite error logging.
-rw-r--r--lib/raidfile/RaidFileWrite.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp
index efec43a2..00067f72 100644
--- a/lib/raidfile/RaidFileWrite.cpp
+++ b/lib/raidfile/RaidFileWrite.cpp
@@ -113,6 +113,7 @@ void RaidFileWrite::Open(bool AllowOverwrite)
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if(mOSFileHandle == -1)
{
+ BOX_LOG_SYS_ERROR("Failed to open file: " << writeFilename);
THROW_EXCEPTION(RaidFileException, ErrorOpeningWriteFile)
}
@@ -274,13 +275,15 @@ void RaidFileWrite::Commit(bool ConvertToRaidNow)
if(::unlink(renameTo.c_str()) != 0 &&
GetLastError() != ERROR_FILE_NOT_FOUND)
{
- BOX_LOG_WIN_ERROR("failed to delete file: " << renameTo);
+ BOX_LOG_WIN_ERROR("Failed to delete file: " << renameTo);
THROW_EXCEPTION(RaidFileException, OSError)
}
#endif
if(::rename(renameFrom.c_str(), renameTo.c_str()) != 0)
{
+ BOX_LOG_SYS_ERROR("Failed to rename file: " << renameFrom <<
+ " to " << renameTo);
THROW_EXCEPTION(RaidFileException, OSError)
}
@@ -335,6 +338,7 @@ void RaidFileWrite::Discard()
::close(mOSFileHandle) != 0)
#endif // !WIN32
{
+ BOX_LOG_SYS_ERROR("Failed to delete file: " << writeFilename);
THROW_EXCEPTION(RaidFileException, OSError)
}
@@ -562,6 +566,8 @@ void RaidFileWrite::TransformToRaidStorage()
ASSERT((::lseek(parity, 0, SEEK_CUR) % blockSize) == 0);
if(::write(parity, &sw, sizeof(sw)) != sizeof(sw))
{
+ BOX_LOG_SYS_ERROR("Failed to write to file: " <<
+ writeFilename);
THROW_EXCEPTION(RaidFileException, OSError)
}
}
@@ -600,6 +606,8 @@ void RaidFileWrite::TransformToRaidStorage()
// Finally delete the write file
if(::unlink(writeFilename.c_str()) != 0)
{
+ BOX_LOG_SYS_ERROR("Failed to delete file: " <<
+ writeFilename);
THROW_EXCEPTION(RaidFileException, OSError)
}
}