summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupDaemon.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-09-01 13:26:31 +0000
committerChris Wilson <chris+github@qwirx.com>2007-09-01 13:26:31 +0000
commit0199687f46d3c51df525feb4fe82bcf42eb4f8d3 (patch)
treedfe564d5c51557f91dbf2713c7aaf98de8baed95 /bin/bbackupd/BackupDaemon.h
parentbc121daa5ce85a575ba0158a923077b068d5dd24 (diff)
Log more detailed errors when the server returns an error while uploading
a file. (merges [1781])
Diffstat (limited to 'bin/bbackupd/BackupDaemon.h')
-rw-r--r--bin/bbackupd/BackupDaemon.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index 7df62c95..47ae1d55 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -21,6 +21,7 @@
#include "SocketListen.h"
#include "SocketStream.h"
#include "Logging.h"
+#include "autogen_BackupProtocolClient.h"
#ifdef WIN32
#include "WinNamedPipeStream.h"
@@ -304,6 +305,70 @@ public:
<< "/" << rException.GetSubType() << ")");
}
}
+ virtual void NotifyFileUploadServerError(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath,
+ int type, int subtype)
+ {
+ std::ostringstream msgs;
+ if (type != BackupProtocolClientError::ErrorType)
+ {
+ msgs << "unknown error type " << type;
+ }
+ else
+ {
+ switch(subtype)
+ {
+ case BackupProtocolClientError::Err_WrongVersion:
+ msgs << "WrongVersion";
+ break;
+ case BackupProtocolClientError::Err_NotInRightProtocolPhase:
+ msgs << "NotInRightProtocolPhase";
+ break;
+ case BackupProtocolClientError::Err_BadLogin:
+ msgs << "BadLogin";
+ break;
+ case BackupProtocolClientError::Err_CannotLockStoreForWriting:
+ msgs << "CannotLockStoreForWriting";
+ break;
+ case BackupProtocolClientError::Err_SessionReadOnly:
+ msgs << "SessionReadOnly";
+ break;
+ case BackupProtocolClientError::Err_FileDoesNotVerify:
+ msgs << "FileDoesNotVerify";
+ break;
+ case BackupProtocolClientError::Err_DoesNotExist:
+ msgs << "DoesNotExist";
+ break;
+ case BackupProtocolClientError::Err_DirectoryAlreadyExists:
+ msgs << "DirectoryAlreadyExists";
+ break;
+ case BackupProtocolClientError::Err_CannotDeleteRoot:
+ msgs << "CannotDeleteRoot";
+ break;
+ case BackupProtocolClientError::Err_TargetNameExists:
+ msgs << "TargetNameExists";
+ break;
+ case BackupProtocolClientError::Err_StorageLimitExceeded:
+ msgs << "StorageLimitExceeded";
+ break;
+ case BackupProtocolClientError::Err_DiffFromFileDoesNotExist:
+ msgs << "DiffFromFileDoesNotExist";
+ break;
+ case BackupProtocolClientError::Err_DoesNotExistInDirectory:
+ msgs << "DoesNotExistInDirectory";
+ break;
+ case BackupProtocolClientError::Err_PatchConsistencyError:
+ msgs << "PatchConsistencyError";
+ break;
+ default:
+ msgs << "unknown error subtype " << subtype;
+ }
+ }
+
+ BOX_ERROR("Failed to upload file: " << rLocalPath
+ << ": server error: " << msgs.str());
+ }
virtual void NotifyFileUploading(
const BackupClientDirectoryRecord* pDirRecord,
const std::string& rLocalPath)