[Box Backup-commit] COMMIT r3356 - box/trunk/bin/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Fri Aug 15 23:47:25 BST 2014


Author: chris
Date: 2014-08-15 23:47:25 +0100 (Fri, 15 Aug 2014)
New Revision: 3356

Modified:
   box/trunk/bin/bbackupd/BackupDaemon.h
Log:
Replace switch statement of protocol errors with BackupProtocolError::GetMessage().

Conflicts:

	bin/bbackupd/BackupDaemon.h

Modified: box/trunk/bin/bbackupd/BackupDaemon.h
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.h	2014-08-15 22:47:22 UTC (rev 3355)
+++ box/trunk/bin/bbackupd/BackupDaemon.h	2014-08-15 22:47:25 UTC (rev 3356)
@@ -366,71 +366,16 @@
 				<< " (" << rException.GetType()
 				<< "/"  << rException.GetSubType() << ")");
 		}
- 	}
-  	virtual void NotifyFileUploadServerError(
- 		const BackupClientDirectoryRecord* pDirRecord,
- 		const std::string& rLocalPath,
- 		int type, int subtype)
- 	{
-		std::ostringstream msgs;
-		if (type != BackupProtocolError::ErrorType)
-		{
-			msgs << "unknown error type " << type;
-		}
-		else
-		{
-			switch(subtype)
-			{
-			case BackupProtocolError::Err_WrongVersion:
-				msgs << "WrongVersion";
-				break;
-			case BackupProtocolError::Err_NotInRightProtocolPhase:
-				msgs << "NotInRightProtocolPhase";
-				break;
-			case BackupProtocolError::Err_BadLogin:
-				msgs << "BadLogin";
-				break;
-			case BackupProtocolError::Err_CannotLockStoreForWriting:
-				msgs << "CannotLockStoreForWriting";
-				break;
-			case BackupProtocolError::Err_SessionReadOnly:
-				msgs << "SessionReadOnly";
-				break;
-			case BackupProtocolError::Err_FileDoesNotVerify:
-				msgs << "FileDoesNotVerify";
-				break;
-			case BackupProtocolError::Err_DoesNotExist:
-				msgs << "DoesNotExist";
-				break;
-			case BackupProtocolError::Err_DirectoryAlreadyExists:
-				msgs << "DirectoryAlreadyExists";
-				break;
-			case BackupProtocolError::Err_CannotDeleteRoot:
-				msgs << "CannotDeleteRoot";
-				break;
-			case BackupProtocolError::Err_TargetNameExists:
-				msgs << "TargetNameExists";
-				break;
-			case BackupProtocolError::Err_StorageLimitExceeded:
-				msgs << "StorageLimitExceeded";
-				break;
-			case BackupProtocolError::Err_DiffFromFileDoesNotExist:
-				msgs << "DiffFromFileDoesNotExist";
-				break;
-			case BackupProtocolError::Err_DoesNotExistInDirectory:
-				msgs << "DoesNotExistInDirectory";
-				break;
-			case BackupProtocolError::Err_PatchConsistencyError:
-				msgs << "PatchConsistencyError";
-				break;
-			default:
-				msgs << "unknown error subtype " << subtype;
-			}
-		}
-
-		BOX_ERROR("Failed to upload file: " << rLocalPath
-			<< ": server error: " << msgs.str());
 	}
+	virtual void NotifyFileUploadServerError(
+		const BackupClientDirectoryRecord* pDirRecord,
+		const std::string& rLocalPath,
+		int type, int subtype)
+	{
+		BOX_ERROR("Failed to upload file: " << rLocalPath <<
+			": server error: " <<
+			BackupProtocolError::GetMessage(subtype));
+	}
 	virtual void NotifyFileUploading(
 		const BackupClientDirectoryRecord* pDirRecord,
 		const std::string& rLocalPath)




More information about the Boxbackup-commit mailing list