From 53c35fb1774e0f817496297f3599bf5e5f773298 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 22 Aug 2013 00:24:19 +0000 Subject: Improve error messages from BackupCommands. When a command is sent in the wrong phase, or a command that requires write access is sent to a read-only session, log an error message with the command details (and current phase in the former case). --- lib/backupstore/BackupCommands.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/backupstore/BackupCommands.cpp b/lib/backupstore/BackupCommands.cpp index 341c7368..1f4244f6 100644 --- a/lib/backupstore/BackupCommands.cpp +++ b/lib/backupstore/BackupCommands.cpp @@ -38,12 +38,17 @@ #define CHECK_PHASE(phase) \ if(rContext.GetPhase() != BackupStoreContext::phase) \ { \ + BOX_ERROR("Received command " << ToString() << " " \ + "in wrong protocol phase " << rContext.GetPhaseName() << ", " \ + "expected in " #phase); \ return PROTOCOL_ERROR(Err_NotInRightProtocolPhase); \ } #define CHECK_WRITEABLE_SESSION \ if(rContext.SessionIsReadOnly()) \ { \ + BOX_ERROR("Received command " << ToString() << " " \ + "in a read-only session"); \ return PROTOCOL_ERROR(Err_SessionReadOnly); \ } -- cgit v1.2.3