[Box Backup-commit] COMMIT r1376 - box/chris/merge/bin/bbackupquery

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Thu Mar 8 22:22:57 GMT 2007


Author: chris
Date: 2007-03-08 22:22:56 +0000 (Thu, 08 Mar 2007)
New Revision: 1376

Modified:
   box/chris/merge/bin/bbackupquery/BackupQueries.cpp
Log:
Catch exceptions during restore and report them, rather than aborting
bbackupquery (refs #3)


Modified: box/chris/merge/bin/bbackupquery/BackupQueries.cpp
===================================================================
--- box/chris/merge/bin/bbackupquery/BackupQueries.cpp	2007-03-08 22:20:31 UTC (rev 1375)
+++ box/chris/merge/bin/bbackupquery/BackupQueries.cpp	2007-03-08 22:22:56 UTC (rev 1376)
@@ -1908,11 +1908,34 @@
 #endif
 
 	// Go and restore...
-	switch(BackupClientRestore(mrConnection, dirID, localName.c_str(), 
-		true /* print progress dots */, restoreDeleted, 
-		false /* don't undelete after restore! */, 
-		opts['r'] /* resume? */))
+	int result;
+
+	try
 	{
+		result = BackupClientRestore(mrConnection, dirID, 
+			localName.c_str(), 
+			true /* print progress dots */, restoreDeleted, 
+			false /* don't undelete after restore! */, 
+			opts['r'] /* resume? */);
+	}
+	catch (BoxException &e)
+	{
+		::syslog(LOG_ERR, "Failed to restore: %s", e.what());
+		return;
+	}
+	catch(std::exception &e)
+	{
+		::syslog(LOG_ERR, "Failed to restore: %s", e.what());
+		return;
+	}
+	catch(...)
+	{
+		::syslog(LOG_ERR, "Failed to restore: unknown error");
+		return;
+	}
+
+	switch(result)
+	{
 	case Restore_Complete:
 		printf("Restore complete\n");
 		break;




More information about the Boxbackup-commit mailing list