[Box Backup-commit] COMMIT r1728 - in box/chris/merge: bin/bbackupd lib/win32

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Thu Jul 26 21:50:46 BST 2007


Author: chris
Date: 2007-07-26 21:50:46 +0100 (Thu, 26 Jul 2007)
New Revision: 1728

Modified:
   box/chris/merge/bin/bbackupd/BackupDaemon.cpp
   box/chris/merge/lib/win32/emu.cpp
Log:
Add more debugging checks and messages for location setup error
reported by Pete Jalajas
(http://lists.warhead.org.uk/pipermail/boxbackup/2007-July/003668.html)


Modified: box/chris/merge/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupDaemon.cpp	2007-07-26 19:35:13 UTC (rev 1727)
+++ box/chris/merge/bin/bbackupd/BackupDaemon.cpp	2007-07-26 20:50:46 UTC (rev 1728)
@@ -1696,7 +1696,11 @@
 				if(::statfs(ploc->mPath.c_str(), &s) != 0)
 #endif // HAVE_STRUCT_STATVFS_F_MNTONNAME
 				{
-					THROW_EXCEPTION(CommonException, OSFileError)
+					BOX_WARNING("Failed to stat location: "
+						<< ploc->mPath 
+						<< ": " << strerror(errno));
+					THROW_EXCEPTION(CommonException,
+						OSFileError)
 				}
 
 				// Where the filesystem is mounted
@@ -1781,13 +1785,24 @@
 				}
 				
 				// Execute create directory command
-				MemBlockStream attrStream(attr);
-				std::auto_ptr<BackupProtocolClientSuccess> dirCreate(connection.QueryCreateDirectory(
-					BackupProtocolClientListDirectory::RootDirectory,
-					attrModTime, dirname, attrStream));
-					
-				// Object ID for later creation
-				oid = dirCreate->GetObjectID();
+				try
+				{
+					MemBlockStream attrStream(attr);
+					std::auto_ptr<BackupProtocolClientSuccess> dirCreate(connection.QueryCreateDirectory(
+						BackupProtocolClientListDirectory::RootDirectory,
+						attrModTime, dirname, attrStream));
+						
+					// Object ID for later creation
+					oid = dirCreate->GetObjectID();
+				}
+				catch (BoxException &e)
+				{
+					BOX_ERROR("Failed to create remote "
+						"directory '/" << dirname <<
+						"', skipping location.");
+					continue;
+				}
+
 			}
 
 			// Create and store the directory object for the root of this location
@@ -1798,6 +1813,15 @@
 			// Push it back on the vector of locations
 			mLocations.push_back(ploc);
 		}
+		catch (std::exception &e)
+		{
+			delete ploc;
+			ploc = 0;
+			BOX_ERROR("Failed to setup location '"
+				<< ploc->mName << "' path '"
+				<< ploc->mPath << "': " << e.what());
+			throw;
+		}
 		catch(...)
 		{
 			delete ploc;

Modified: box/chris/merge/lib/win32/emu.cpp
===================================================================
--- box/chris/merge/lib/win32/emu.cpp	2007-07-26 19:35:13 UTC (rev 1727)
+++ box/chris/merge/lib/win32/emu.cpp	2007-07-26 20:50:46 UTC (rev 1728)
@@ -390,6 +390,10 @@
 	WCHAR* pWide = ConvertToWideString(rSource.c_str(), sourceCodePage);
 	if (pWide == NULL)
 	{
+		::syslog(LOG_ERR, "Failed to convert string '%s' from "
+			"current code page %d to wide string: %s",
+			rSource.c_str(), sourceCodePage,
+			GetErrorMessage(GetLastError()).c_str());
 		return false;
 	}
 
@@ -398,6 +402,7 @@
 
 	if (!pConsole)
 	{
+		// Error should have been logged by ConvertFromWideString
 		return false;
 	}
 




More information about the Boxbackup-commit mailing list