[Box Backup-commit] COMMIT r1276 - box/chris/merge/lib/backupclient

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Fri, 09 Feb 2007 22:51:04 +0000


Author: chris
Date: 2007-02-09 22:51:04 +0000 (Fri, 09 Feb 2007)
New Revision: 1276

Modified:
   box/chris/merge/lib/backupclient/BackupClientRestore.cpp
Log:
Don't throw an exception if we fail to delete a file in the way of restore,
just log the error and return an error code (refs #3)


Modified: box/chris/merge/lib/backupclient/BackupClientRestore.cpp
===================================================================
--- box/chris/merge/lib/backupclient/BackupClientRestore.cpp	2007-02-09 22:36:18 UTC (rev 1275)
+++ box/chris/merge/lib/backupclient/BackupClientRestore.cpp	2007-02-09 22:51:04 UTC (rev 1276)
@@ -263,7 +263,11 @@
 				::printf("WARNING: File present with name '%s', removing out of the way of restored directory. Use specific restore with ID to restore this object.", rLocalDirectoryName.c_str());
 				if(::unlink(rLocalDirectoryName.c_str()) != 0)
 				{
-					THROW_EXCEPTION(CommonException, OSFileError);
+					::syslog(LOG_ERR, "Failed to delete "
+						"directory %s: %s",
+						rLocalDirectoryName.c_str(),
+						strerror(errno));
+					return Restore_UnknownError;
 				}
 				TRACE1("In restore, directory name collision with file %s", rLocalDirectoryName.c_str());
 			}