From 1edb424b734ea3e4f2128e1cbc77a22bd001f8d5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Apr 2014 19:22:54 +0000 Subject: Add a ToString method to IOStream and some subclasses. Useful to help debug problems such as invalid file headers when the source of the stream might not be too obvious. --- lib/backupstore/BackupStoreDirectory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/backupstore') diff --git a/lib/backupstore/BackupStoreDirectory.cpp b/lib/backupstore/BackupStoreDirectory.cpp index 81126ede..0c575c51 100644 --- a/lib/backupstore/BackupStoreDirectory.cpp +++ b/lib/backupstore/BackupStoreDirectory.cpp @@ -133,11 +133,11 @@ void BackupStoreDirectory::ReadFromStream(IOStream &rStream, int Timeout) if(OBJECTMAGIC_DIR_MAGIC_VALUE != ntohl(hdr.mMagicValue)) { THROW_EXCEPTION_MESSAGE(BackupStoreException, BadDirectoryFormat, - "Wrong magic number in directory object " << - BOX_FORMAT_OBJECTID(mObjectID) << ": expected " << + "Wrong magic number for directory: expected " << BOX_FORMAT_HEX32(OBJECTMAGIC_DIR_MAGIC_VALUE) << " but found " << - BOX_FORMAT_HEX32(ntohl(hdr.mMagicValue))); + BOX_FORMAT_HEX32(ntohl(hdr.mMagicValue)) << " in " << + rStream.ToString()); } // Get data -- cgit v1.2.3