summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-07-26 20:50:46 +0000
committerChris Wilson <chris+github@qwirx.com>2007-07-26 20:50:46 +0000
commitee62a6ec511a7699e276aae63927a3fa1ce6df2e (patch)
treedd8348e4dd4c5e79b3fad4edb41b45d13b1a06e5 /bin/bbackupd
parent1893383ff18bf5af2443c467b3811c8544653f1e (diff)
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)
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index d690e299..4a72f762 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -1696,7 +1696,11 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
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 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
}
// 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 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
// 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;