[Box Backup-commit] COMMIT r3495 - box/trunk/lib/raidfile

subversion at boxbackup.org subversion at boxbackup.org
Fri Dec 26 23:16:49 GMT 2014


Author: chris
Date: 2014-12-26 23:16:49 +0000 (Fri, 26 Dec 2014)
New Revision: 3495

Modified:
   box/trunk/lib/raidfile/RaidFileRead.cpp
Log:
Improve some exception messages in lib/raidfile.

Use the new macros to ensure that exceptions contain a message and filename,
following the new standard format.

Modified: box/trunk/lib/raidfile/RaidFileRead.cpp
===================================================================
--- box/trunk/lib/raidfile/RaidFileRead.cpp	2014-12-26 23:16:46 UTC (rev 3494)
+++ box/trunk/lib/raidfile/RaidFileRead.cpp	2014-12-26 23:16:49 UTC (rev 3495)
@@ -1510,7 +1510,10 @@
 			else
 			{
 				// No. It's a file. Bad!
-				THROW_EXCEPTION(RaidFileException, UnexpectedFileInDirPlace)
+				THROW_FILE_ERROR("Expected a directory, "
+					"found something else", dn,
+					RaidFileException,
+					UnexpectedFileInDirPlace);
 			}
 		}
 		else
@@ -1519,7 +1522,9 @@
 			if(errno != ENOENT)
 			{
 				// No. Bad things.
-				THROW_EXCEPTION(RaidFileException, OSError)
+				THROW_SYS_FILE_ERROR("Failed to check for "
+					"existing RaidFile directory", dn,
+					RaidFileException, OSError);
 			}
 		}
 	}
@@ -1621,8 +1626,11 @@
 				std::string fullName(dn + DIRECTORY_SEPARATOR + en->d_name);
 				if(EMU_LSTAT(fullName.c_str(), &st) != 0)
 				{
-					THROW_EXCEPTION(RaidFileException, OSError)
+					THROW_SYS_FILE_ERROR("Failed to stat",
+						fullName, RaidFileException,
+						OSError);
 				}
+
 				if(DirReadType == DirReadType_FilesOnly && (st.st_mode & S_IFDIR) == 0)
 #endif
 				{




More information about the Boxbackup-commit mailing list