summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-10-14 14:50:33 +0000
committerChris Wilson <chris+github@qwirx.com>2006-10-14 14:50:33 +0000
commit19976d47669d7e3345266b1f8bd9d4552d3519f1 (patch)
tree945ab61d1b743864a833b6e582c8b34c5ada5c99 /bin
parent755674d88629065899cafad0e1fa7cdde20e7b31 (diff)
* Catch invalid output from sync allow script and tell the user what it
was, to help them debug the problem (refs #3)
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 023678ec..8f993067 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -59,6 +59,7 @@
#include "BackupStoreFilenameClear.h"
#include "BackupClientInodeToIDMap.h"
#include "autogen_BackupProtocolClient.h"
+#include "autogen_ConversionException.h"
#include "BackupClientCryptoKeys.h"
#include "BannerText.h"
#include "BackupStoreFile.h"
@@ -934,8 +935,21 @@ int BackupDaemon::UseScriptToSeeIfSyncAllowed()
}
else
{
- // How many seconds to wait?
- waitInSeconds = BoxConvert::Convert<int32_t, const std::string&>(line);
+ try
+ {
+ // How many seconds to wait?
+ waitInSeconds = BoxConvert::Convert<int32_t, const std::string&>(line);
+ }
+ catch(ConversionException &e)
+ {
+ ::syslog(LOG_ERR, "Invalid output "
+ "from SyncAllowScript '%s': "
+ "'%s'",
+ conf.GetKeyValue("SyncAllowScript").c_str(),
+ line.c_str());
+ throw;
+ }
+
::syslog(LOG_INFO, "Delaying sync by %d seconds (SyncAllowScript '%s')", waitInSeconds, conf.GetKeyValue("SyncAllowScript").c_str());
}
}