summaryrefslogtreecommitdiff
path: root/bin/bbackupquery
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-11-06 23:25:48 +0000
committerChris Wilson <chris+github@qwirx.com>2007-11-06 23:25:48 +0000
commit96aa8e38c4c6d3d326541de849dfad610030620c (patch)
tree5d54efb3a132f9c9d71bc92a9daedc88eee311f7 /bin/bbackupquery
parentf6b7f12bc7f41155595dd92d18991a154e85b8eb (diff)
Ensure that restore failure sets the return code from bbackupquery, so
that symlink following test fails.
Diffstat (limited to 'bin/bbackupquery')
-rw-r--r--bin/bbackupquery/BackupQueries.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index 55aa00d8..b6984641 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -2028,11 +2028,13 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
catch(std::exception &e)
{
BOX_ERROR("Failed to restore: " << e.what());
+ SetReturnCode(COMMAND_RETURN_ERROR);
return;
}
catch(...)
{
BOX_ERROR("Failed to restore: unknown exception");
+ SetReturnCode(COMMAND_RETURN_ERROR);
return;
}
@@ -2044,10 +2046,12 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
case Restore_ResumePossible:
BOX_ERROR("Resume possible -- repeat command with -r flag to resume");
+ SetReturnCode(COMMAND_RETURN_ERROR);
break;
case Restore_TargetExists:
BOX_ERROR("The target directory exists. You cannot restore over an existing directory.");
+ SetReturnCode(COMMAND_RETURN_ERROR);
break;
#ifdef WIN32
@@ -2055,15 +2059,18 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
BOX_ERROR("The target directory path does not exist.\n"
"To restore to a directory whose parent "
"does not exist, create the parent first.");
+ SetReturnCode(COMMAND_RETURN_ERROR);
break;
#endif
case Restore_UnknownError:
BOX_ERROR("Unknown error during restore.");
+ SetReturnCode(COMMAND_RETURN_ERROR);
break;
default:
BOX_ERROR("Unknown restore result " << result << ".");
+ SetReturnCode(COMMAND_RETURN_ERROR);
break;
}
}