From 86300ca399680282c05bdccf1cf2830bea1f49d7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 16 Dec 2006 16:12:35 +0000 Subject: Improved debugging when a path to a location doesn't exist or can't be opened. (refs #3) --- bin/bbackupd/BackupDaemon.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 4f9c9274..87955fa4 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -1562,8 +1562,19 @@ TRACE0("new location\n"); // First, get the directory's attributes and modification time box_time_t attrModTime = 0; BackupClientFileAttributes attr; - attr.ReadAttributes(ploc->mPath.c_str(), true /* directories have zero mod times */, - 0 /* not interested in mod time */, &attrModTime /* get the attribute modification time */); + try + { + attr.ReadAttributes(ploc->mPath.c_str(), + true /* directories have zero mod times */, + 0 /* not interested in mod time */, + &attrModTime /* get the attribute modification time */); + } + catch (BoxException &e) + { + ::syslog(LOG_ERR, "Failed to get attributes for path " + "'%s', skipping.", ploc->mPath.c_str()); + continue; + } // Execute create directory command MemBlockStream attrStream(attr); @@ -1587,6 +1598,8 @@ TRACE0("new location\n"); { delete ploc; ploc = 0; + ::syslog(LOG_ERR, "Failed to setup location '%s' path '%s'", + ploc->mName.c_str(), ploc->mPath.c_str()); throw; } } -- cgit v1.2.3