From 82bea7ee6395af37ff2b6183e4ed49313dcc3539 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 28 Apr 2007 17:37:37 +0000 Subject: Improve error messages when Getting a file fails with an exception. (refs #3) --- bin/bbackupquery/BackupQueries.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin/bbackupquery') diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 1e7aebe1..29108786 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -47,6 +47,7 @@ #include "ExcludeList.h" #include "BackupClientMakeExcludeList.h" #include "PathUtils.h" +#include "Logging.h" #include "MemLeakFindOn.h" @@ -1032,10 +1033,22 @@ void BackupQueries::CommandGet(std::vector args, const bool *opts) // Done. printf("Object ID %08llx fetched sucessfully.\n", fileId); } + catch (BoxException &e) + { + BOX_ERROR("Failed to fetch file: " << + e.what()); + ::unlink(localName.c_str()); + } + catch(std::exception &e) + { + BOX_ERROR("Failed to fetch file: " << + e.what()); + ::unlink(localName.c_str()); + } catch(...) { + BOX_ERROR("Failed to fetch file: unknown error"); ::unlink(localName.c_str()); - printf("Error occured fetching file.\n"); } } -- cgit v1.2.3