summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2013-08-22 00:24:19 +0000
committerChris Wilson <chris+github@qwirx.com>2013-08-22 00:24:19 +0000
commit53c35fb1774e0f817496297f3599bf5e5f773298 (patch)
treeaa0be8aa3bb4a5263ea24a5acdb7aea0d26d0ce9
parent941878563294255f44a11aa8164a4b330770c4c2 (diff)
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).
-rw-r--r--lib/backupstore/BackupCommands.cpp5
1 files changed, 5 insertions, 0 deletions
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); \
}