From b557bd2fa0256ba4cca41d205e7b0b69602f9f18 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 20 Aug 2006 23:41:07 +0000 Subject: * bin/bbackupd/BackupDaemon.cpp - Improved exception messages for reading and writing the StoreObjectInfoFile, and made them consistent. --- bin/bbackupd/BackupDaemon.cpp | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'bin/bbackupd/BackupDaemon.cpp') diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 9a3035ee..2e80cd2d 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -2333,13 +2333,33 @@ bool BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time ::syslog(LOG_INFO, "Saved store object info file '%s'", StoreObjectInfoFile.c_str()); } + catch(std::exception &e) + { + ::syslog(LOG_ERR, "Internal error writing store object " + "info file (%s): %s", + StoreObjectInfoFile.c_str(), e.what()); + } catch(...) { - ::syslog(LOG_WARNING, "Requested store object info file '%s' " - "not accessible or could not be created", + ::syslog(LOG_ERR, "Internal error writing store object " + "info file (%s): unknown error", StoreObjectInfoFile.c_str()); } + DeleteAllLocations(); + catch(std::exception &e) + { + ::syslog(LOG_WARNING, "Requested store object info file '%s' " + "not accessible or could not be created: %s", + StoreObjectInfoFile.c_str(), e.what()); + } + catch(...) + { + ::syslog(LOG_WARNING, "Requested store object info file '%s' " + "not accessible or could not be created: " + "unknown error", StoreObjectInfoFile.c_str()); + } + return created; } @@ -2492,12 +2512,14 @@ bool BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_ catch(std::exception &e) { ::syslog(LOG_ERR, "Internal error reading store object " - "info file: %s", e.what()); + "info file (%s): %s", + StoreObjectInfoFile.c_str(), e.what()); } catch(...) { ::syslog(LOG_ERR, "Internal error reading store object " - "info file: unknown error"); + "info file (%s): unknown error", + StoreObjectInfoFile.c_str()); } DeleteAllLocations(); -- cgit v1.2.3