diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-04-29 19:22:54 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-04-29 19:22:54 +0000 |
commit | 1edb424b734ea3e4f2128e1cbc77a22bd001f8d5 (patch) | |
tree | da3e95edf1ab1a1808ac6673811f76610f9dfce2 /lib/backupstore/BackupStoreDirectory.cpp | |
parent | 1ce71f487e6cd6514198c3769cd0a337395c1f8e (diff) |
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.
Diffstat (limited to 'lib/backupstore/BackupStoreDirectory.cpp')
-rw-r--r-- | lib/backupstore/BackupStoreDirectory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 |