diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-08 22:22:56 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-08 22:22:56 +0000 |
commit | d9f8b29cd22545460f52026442b69f20da97cc9f (patch) | |
tree | 447c7fbfa91bcf287f7e4f8ab2db559eca024796 /bin/bbackupquery | |
parent | 5ccb219180e3e057d08342dffccb5a1759a67971 (diff) |
Catch exceptions during restore and report them, rather than aborting
bbackupquery (refs #3)
Diffstat (limited to 'bin/bbackupquery')
-rw-r--r-- | bin/bbackupquery/BackupQueries.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index acece91d..08e1422f 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -1908,10 +1908,33 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b #endif // Go and restore... - switch(BackupClientRestore(mrConnection, dirID, localName.c_str(), - true /* print progress dots */, restoreDeleted, - false /* don't undelete after restore! */, - opts['r'] /* resume? */)) + int result; + + try + { + result = BackupClientRestore(mrConnection, dirID, + localName.c_str(), + true /* print progress dots */, restoreDeleted, + false /* don't undelete after restore! */, + opts['r'] /* resume? */); + } + catch (BoxException &e) + { + ::syslog(LOG_ERR, "Failed to restore: %s", e.what()); + return; + } + catch(std::exception &e) + { + ::syslog(LOG_ERR, "Failed to restore: %s", e.what()); + return; + } + catch(...) + { + ::syslog(LOG_ERR, "Failed to restore: unknown error"); + return; + } + + switch(result) { case Restore_Complete: printf("Restore complete\n"); |