From a04092e0dfa58849c63b720284cf88437767b890 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 28 Apr 2007 20:43:48 +0000 Subject: Improve error messages when compare throws an exception. (refs #3) --- bin/bbackupquery/BackupQueries.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'bin/bbackupquery/BackupQueries.cpp') diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 29108786..e31df624 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -1715,15 +1715,27 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s } catch(BoxException &e) { - printf("ERROR: (%d/%d) during file fetch and comparison for '%s'\n", - e.GetType(), - e.GetSubType(), - storePathDisplay.c_str()); + BOX_ERROR("Failed to fetch and compare " + "'" << + storePathDisplay.c_str() << + "': error " << e.what() << + " (" << e.GetType() << + "/" << e.GetSubType() << ")"); rParams.mUncheckedFiles ++; } + catch(std::exception &e) + { + BOX_ERROR("Failed to fetch and compare " + "'" << + storePathDisplay.c_str() << + "': " << e.what()); + } catch(...) { - printf("ERROR: (unknown) during file fetch and comparison for '%s'\n", storePathDisplay.c_str()); + BOX_ERROR("Failed to fetch and compare " + "'" << + storePathDisplay.c_str() << + "': unknown error"); rParams.mUncheckedFiles ++; } -- cgit v1.2.3