From 3cf9311eba9e6b8374b877eea385031936d187ba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 6 Apr 2015 19:41:22 +0000 Subject: Improve error logging in win32 emu library. Consistently capture the last Windows error code in the global variable winerrno. Add logging macros that report the Windows error message for this error code. --- lib/backupstore/BackupStoreRefCountDatabase.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/backupstore/BackupStoreRefCountDatabase.cpp') diff --git a/lib/backupstore/BackupStoreRefCountDatabase.cpp b/lib/backupstore/BackupStoreRefCountDatabase.cpp index e561f52b..8929b691 100644 --- a/lib/backupstore/BackupStoreRefCountDatabase.cpp +++ b/lib/backupstore/BackupStoreRefCountDatabase.cpp @@ -70,14 +70,15 @@ void BackupStoreRefCountDatabase::Commit() #ifdef WIN32 if(FileExists(Final_Filename) && unlink(Final_Filename.c_str()) != 0) { - THROW_SYS_FILE_ERROR("Failed to delete old permanent refcount " - "database file", mFilename, CommonException, OSFileError); + THROW_EMU_FILE_ERROR("Failed to delete old permanent refcount " + "database file", mFilename, CommonException, + OSFileError); } #endif if(rename(mFilename.c_str(), Final_Filename.c_str()) != 0) { - THROW_SYS_ERROR("Failed to rename temporary refcount database " + THROW_EMU_ERROR("Failed to rename temporary refcount database " "file from " << mFilename << " to " << Final_Filename, CommonException, OSFileError); } @@ -106,8 +107,9 @@ void BackupStoreRefCountDatabase::Discard() if(unlink(mFilename.c_str()) != 0) { - THROW_SYS_FILE_ERROR("Failed to delete temporary refcount database " - "file ", mFilename, CommonException, OSFileError); + THROW_EMU_FILE_ERROR("Failed to delete temporary refcount " + "database file", mFilename, CommonException, + OSFileError); } mIsModified = false; -- cgit v1.2.3