[Box Backup-dev] COMMIT r231 - box/chris/boxi/bin/bbackupquery
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Wed Dec 14 23:47:48 GMT 2005
Author: chris
Date: 2005-12-14 23:47:44 +0000 (Wed, 14 Dec 2005)
New Revision: 231
Modified:
box/chris/boxi/bin/bbackupquery/BackupQueries.cpp
Log:
* BackupQueries.cpp
- Don't abort if the server sends back an error, but show error details instead
Modified: box/chris/boxi/bin/bbackupquery/BackupQueries.cpp
===================================================================
--- box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-14 23:19:45 UTC (rev 230)
+++ box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-14 23:47:44 UTC (rev 231)
@@ -333,16 +333,21 @@
return;
}
}
-
- // List it
- List(rootDir, listRoot, opts, true /* first level to list */);
+
+ try
+ {
+ // List it
+ List(rootDir, listRoot, opts, true /* first level to list */);
+ } catch (BoxException &e) {
+ printf("Error from server: %s\n", e.what());
+ }
}
// --------------------------------------------------------------------------
//
// Function
-// Name: BackupQueries::CommandList2(int64_t, const std::string &, const bool *)
+// Name: BackupQueries::List(int64_t, const std::string &, const bool *)
// Purpose: Do the actual listing of directories and files
// Created: 2003/10/10
//
@@ -355,12 +360,30 @@
if(!opts[LIST_OPTION_ALLOWDELETED]) excludeFlags |= BackupProtocolClientListDirectory::Flags_Deleted;
// Do communication
- mrConnection.QueryListDirectory(
+ BackupProtocolClientListDirectory send(
DirID,
BackupProtocolClientListDirectory::Flags_INCLUDE_EVERYTHING, // both files and directories
excludeFlags,
true /* want attributes */);
+ try
+ {
+ mrConnection.Query(send);
+ }
+ catch (BoxException &e)
+ {
+ int type, subtype;
+ if (send.IsError(type, subtype) &&
+ type == BackupProtocolClientError::ErrorType)
+ {
+ throw ConnectionException(subtype);
+ }
+ else
+ {
+ throw ConnectionException(e.GetSubType());
+ }
+ }
+
// Retrieve the directory from the stream following
BackupStoreDirectory dir;
std::auto_ptr<IOStream> dirstream(mrConnection.ReceiveStream());
More information about the Boxbackup-dev
mailing list